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

node number -1: !input.isBool() #534

Closed
tianwen0110 opened this issue Sep 25, 2020 · 2 comments · Fixed by #620
Closed

node number -1: !input.isBool() #534

tianwen0110 opened this issue Sep 25, 2020 · 2 comments · Fixed by #620
Assignees
Labels
enhancement New feature or request triaged Issue has been triaged by maintainers

Comments

@tianwen0110
Copy link

I convert a pytorch model to onnx model successfully, but when I try to convert this model to trt, an error occours:

[TensorRT] WARNING: onnx2trt_utils.cpp:220: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32. [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped [TensorRT] WARNING: onnx2trt_utils.cpp:246: One or more weights outside the range of INT32 was clamped Traceback (most recent call last): File "/home/yckj3858/anaconda3/envs/pytorch/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/home/yckj3858/anaconda3/envs/pytorch/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/yckj3858/.vscode-server/extensions/ms-python.python-2020.9.111407/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module> cli.main() File "/home/yckj3858/.vscode-server/extensions/ms-python.python-2020.9.111407/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 430, in main run() File "/home/yckj3858/.vscode-server/extensions/ms-python.python-2020.9.111407/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("__main__")) File "/home/yckj3858/anaconda3/envs/pytorch/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/home/yckj3858/anaconda3/envs/pytorch/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/home/yckj3858/anaconda3/envs/pytorch/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/yckj3858/mmdetection/tools/onnx_trt.py", line 138, in <module> engine = backend.prepare(onnx_model) File "/home/yckj3858/onnx-tensorrt/onnx_tensorrt/backend.py", line 200, in prepare return TensorRTBackendRep(model, device, **kwargs) File "/home/yckj3858/onnx-tensorrt/onnx_tensorrt/backend.py", line 86, in __init__ raise RuntimeError(msg) RuntimeError: While parsing node number -1: builtin_op_importers.cpp:385 In function importConcat: [8] Assertion failed: !input.isBool()

Does anyone know how to solve it? The print confuse me: there is not a node number -1 and the input cannot be bool type. I only run the code:

import onnx_tensorrt.backend as backend onnx_model = onnx.load('tmp3.onnx') engine = backend.prepare(onnx_model)

And the error occour, tmp3.onnx is my onnx model. Hope your reply!

@jianan86
Copy link

same issues, Have you solved it?

@kevinch-nv kevinch-nv added enhancement New feature or request triaged Issue has been triaged by maintainers labels Jan 7, 2021
@kevinch-nv
Copy link
Collaborator

TRT doesn't natively support BOOL types in its concat layer. I think we can WAR this by casting the bool tensors to INT, doing the concat, and casting back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triaged Issue has been triaged by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants