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: 'NoneType' object has no attribute 'create_execution_context' #13

Open
rsj007 opened this issue Jun 21, 2021 · 3 comments

Comments

@rsj007
Copy link

rsj007 commented Jun 21, 2021

Hi! I want to convert my onnx to tensorrt model. The error is shown below. Could you please tell me how to solve it?

[TensorRT] ERROR: INVALID_ARGUMENT: getPluginCreator could not find plugin ScatterND version 1
In node -1 (importFallbackPluginImporter): UNSUPPORTED_NODE: Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
[TensorRT] ERROR: Network must have at least one output
[TensorRT] ERROR: Network validation failed.
Traceback (most recent call last):
File "zed_onnx2trt.py", line 9, in
trt_model = onnx2trt(model)
File "/home/nvidia/.local/lib/python3.6/site-packages/volksdep/converters/onnx2trt.py", line 119, in onnx2trt
trt_model = TRTModel(engine)
File "/home/nvidia/.local/lib/python3.6/site-packages/volksdep/converters/base.py", line 50, in init
self.context = self.engine.create_execution_context()
AttributeError: 'NoneType' object has no attribute 'create_execution_context'

@hxcai
Copy link
Collaborator

hxcai commented Jun 21, 2021

@rsj007 Some of your onnx operation is not supported by TensorRT. Do you use PyTorch to generate your onnx model? And which opset version do you use?

@rsj007
Copy link
Author

rsj007 commented Jun 21, 2021

@hxcai Yes, my pytorch model contains grid_sampler which is not supported by ONNX. I use Tensorrt OSS to build this custom operator as "https://github.com/TrojanXu/onnxparser-trt-plugin-sample" said. In this way, I have converted pytorch to onnx. But the onnx file cannot be converted to tensorrt and the error is above shown.
The opset is 11.

@hxcai
Copy link
Collaborator

hxcai commented Jun 21, 2021

@rsj007 You may compile grid sampler following "https://github.com/TrojanXu/onnxparser-trt-plugin-sample" because our tool dose not contain operation plugin. And we suggest to use opset 9.

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