Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'numpy' has no attribute 'bool' coming from tensorrt_engine.py #952

Open
nbulkabf opened this issue Jan 2, 2024 · 1 comment

Comments

@nbulkabf
Copy link

nbulkabf commented Jan 2, 2024

Description

I'm trying to use an onnx model export of a distilled bart mnli model for inference and getting the following when trying

output_data = engine.run({0:profile_0, 1:profile_1})

Traceback (most recent call last):
File "/home/ubuntu/test.py", line 55, in
output_data = engine.run({0:profile_0, 1:profile_1})
File "/home/ubuntu/gpupyenv/lib/python3.10/site-packages/onnx_tensorrt-8.6.1-py3.10.egg/onnx_tensorrt/backend.py", line 158, in run
File "/home/ubuntu/gpupyenv/lib/python3.10/site-packages/onnx_tensorrt-8.6.1-py3.10.egg/onnx_tensorrt/backend.py", line 135, in build_engine
File "/home/ubuntu/gpupyenv/lib/python3.10/site-packages/onnx_tensorrt-8.6.1-py3.10.egg/onnx_tensorrt/tensorrt_engine.py", line 101, in init
File "/home/ubuntu/gpupyenv/lib/python3.10/site-packages/onnx_tensorrt-8.6.1-py3.10.egg/onnx_tensorrt/tensorrt_engine.py", line 101, in
File "/home/ubuntu/gpupyenv/lib/python3.10/site-packages/onnx_tensorrt-8.6.1-py3.10.egg/onnx_tensorrt/tensorrt_engine.py", line 29, in init
File "/home/ubuntu/gpupyenv/lib/python3.10/site-packages/numpy/init.py", line 324, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'bool
'?

Is this a straightforward fix by just updating np.bool to bool like the error message suggests? Maybe there is a workaround pinning numpy to a specific version?

Environment

TensorRT Version: 9.2.0.post12.dev5
ONNX-TensorRT Version / Branch: onnx_tensorrt-8.6.1-py3.10.egg
GPU Type: A10G
Nvidia Driver Version: 535.129.03
CUDA Version: 12.2
CUDNN Version: ?
Operating System + Version: ubuntu 22.04.1
Python Version (if applicable): 3.10
TensorFlow + TF2ONNX Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag): Baremetal

Relevant Files

Steps To Reproduce

@ChandanVerma
Copy link

facing same issue. Did you manage to resolve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants