Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

AttributeError: module 'numpy' has no attribute 'bool' #30

@ClementCJ

Description

@ClementCJ

After got unet.engine, then run "python demo.py", and got the following errors, who know this issue, thanks!
(env_py39) [jch@localhost TensorRT]$ python demo.py
[12/27/2022-06:37:00] [TRT] [W] The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
/home/jch/anaconda3/envs/env_py39/lib/python3.9/site-packages/tensorrt/init.py:166: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar. (This may have returned Python scalars in past versions.
bool: np.bool,
Traceback (most recent call last):
File "/home/jch/work/x-stable-diffusion/TensorRT/demo.py", line 125, in
model = TrtDiffusionModel(args)
File "/home/jch/work/x-stable-diffusion/TensorRT/demo.py", line 48, in init
self.unet = TRTModel(args.trt_unet_save_path)
File "/home/jch/work/x-stable-diffusion/TensorRT/trt_model.py", line 41, in init
self.inputs, self.outputs, self.bindings, self.stream = self.allocate_buffers(
File "/home/jch/work/x-stable-diffusion/TensorRT/trt_model.py", line 79, in allocate_buffers
dtype = trt.nptype(engine.get_binding_dtype(binding))
File "/home/jch/anaconda3/envs/env_py39/lib/python3.9/site-packages/tensorrt/init.py", line 166, in nptype
bool: np.bool,
File "/home/jch/anaconda3/envs/env_py39/lib/python3.9/site-packages/numpy/init.py", line 284, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool'
Segmentation fault

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions