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

Jetson Nano: AttributeError: 'NoneType' object has no attribute 'create_execution_context #46

Open
lesreaper opened this issue Jun 24, 2021 · 1 comment

Comments

@lesreaper
Copy link

lesreaper commented Jun 24, 2021

System

Library Version
Jetson Nano on Jetpack 4.5.1
CUDA 10.2
TensorRT 7.1.3
PyTorch 1.8
TorchVision 0.9.0
Tensorflow 2.4.0

Verified USB Webcam is working with OpenCV and Tensorflow TRT Yolo model in same virtual environment.

Installed system requirements, installed trt_pose repo, downloaded model assets to the /models directory, and getting this error when running:
python iva.py 0

optimized model path: /home/nvidia/ActionAI/models/resnet18_baseline_att_224x224_A_epoch_249_trt.pth
[TensorRT] ERROR: coreReadArchive.cpp (31) - Serialization Error in verifyHeader: 0 (Magic tag does not match)
[TensorRT] ERROR: INVALID_STATE: std::exception
[TensorRT] ERROR: INVALID_CONFIG: Deserialize the cuda engine failed.
Traceback (most recent call last):
  File "iva.py", line 42, in <module>
    model_trt.load_state_dict(torch.load(OPTIMIZED_MODEL))
  File "/home/nvidia/.virtualenvs/py3tf23cv4/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1209, in load_state_dict
    load(self)
  File "/home/nvidia/.virtualenvs/py3tf23cv4/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1204, in load
    state_dict, prefix, local_metadata, True, missing_keys, unexpected_keys, error_msgs)
  File "/home/nvidia/.virtualenvs/py3tf23cv4/lib/python3.6/site-packages/torch2trt-0.2.0-py3.6-linux-aarch64.egg/torch2trt/torch2trt.py", line 454, in _load_from_state_dict
    self.context = self.engine.create_execution_context()
AttributeError: 'NoneType' object has no attribute 'create_execution_context'

There is an article on nVIdia which says this could be to mismatching input sizes, though I don't see how that could be. The other thing is it could be a TensorRT incompatibility.

Has anyone been able to get this running on a Jetson Nano with the Jetpack 4.5? Any ideas out there?

@alice929
Copy link

Have you solved the above problem?

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