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' #3805

Open
Mohammedfisal1250 opened this issue Apr 19, 2024 · 4 comments
Labels
triaged Issue has been triaged by maintainers

Comments

@Mohammedfisal1250
Copy link

AttributeError: 'NoneType' object has no attribute 'create_execution_context'
TensorRT Version:
8.6.1
NVIDIA GPU:
Quadro M2000M
NVIDIA Driver Version:
551.52
CUDA Version:
release 11.3
CUDNN Version:
8.9.0
Operating System:
Windows-10-10.0.19045-SP0
Python Version (if applicable):
3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)]
Tensorflow Version (if applicable):
2.16.1
PyTorch Version (if applicable):
1.11.0+cu113
Baremetal or Container (if so, version):
Baremetal

please help!

@lix19937
Copy link

NOTE: context = engine.create_execution_context()

maybe your engine is not deserialized.

@Mohammedfisal1250
Copy link
Author

@lix19937 how i can solve this "deserialized"

also when i want transfer my .pt model to .engine whit use the below code i get this error" File "C:\GUI_SANANN_FACTORY\REPORTS\from_pt_to_engine.py", line 10, in
model.export(format = 'engine', device=0)
File "C:\Users\LENOVO\anaconda3\lib\site-packages\ultralytics\engine\model.py", line 577, in export
return Exporter(overrides=args, _callbacks=self.callbacks)(model=self.model)
File "C:\Users\LENOVO\anaconda3\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "C:\Users\LENOVO\anaconda3\lib\site-packages\ultralytics\engine\exporter.py", line 275, in call
f[1], _ = self.export_engine()
File "C:\Users\LENOVO\anaconda3\lib\site-packages\ultralytics\engine\exporter.py", line 136, in outer_func
raise e
File "C:\Users\LENOVO\anaconda3\lib\site-packages\ultralytics\engine\exporter.py", line 131, in outer_func
f, model = inner_func(*args, **kwargs)
File "C:\Users\LENOVO\anaconda3\lib\site-packages\ultralytics\engine\exporter.py", line 700, in export_engine
with builder.build_engine(network, config) as engine, open(f, "wb") as t:
AttributeError: enter"

my code
import torch.onnx
from ultralytics import YOLO
model = YOLO("C:\GUI_SANANN_FACTORY\sanaa_factory_yolo8n_100_epoch_300_img.pt")
model.export(format = 'engine', device=0)

please help me

@lix19937
Copy link

lix19937 commented Apr 21, 2024

with builder.build_engine(network, config) as engine, open(f, "wb") as t:
AttributeError: enter"

raise error, you need check your code.

@Mohammedfisal1250
Copy link
Author

@lix19937 thank you so much

@zerollzeng zerollzeng added the triaged Issue has been triaged by maintainers label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants