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

No module named 'onnx' #191

Closed
ugkjkj opened this issue Jan 12, 2024 · 6 comments
Closed

No module named 'onnx' #191

ugkjkj opened this issue Jan 12, 2024 · 6 comments

Comments

@ugkjkj
Copy link

ugkjkj commented Jan 12, 2024

C:\Users\15258>python3 "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\infer-det.py" --engine "C:\Users\15258\Desktop\model++\runs\detect\train26\weights\best.engine" --imgs "C:\Users\15258\Desktop\model++\000002 copy.jpg" --out-dir outputs --device cuda:0
Traceback (most recent call last):
File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\infer-det.py", line 1, in
from models import TRTModule # isort:skip
File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\models_init_.py", line 1, in
from .engine import EngineBuilder, TRTModule, TRTProfilerV0, TRTProfilerV1 # isort:skip # noqa: E501
File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\models\engine.py", line 7, in
import onnx
ModuleNotFoundError: No module named 'onnx'

@triple-Mu
Copy link
Owner

C:\Users\15258>python3 "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\infer-det.py" --engine "C:\Users\15258\Desktop\model++\runs\detect\train26\weights\best.engine" --imgs "C:\Users\15258\Desktop\model++\000002 copy.jpg" --out-dir outputs --device cuda:0 Traceback (most recent call last): File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\infer-det.py", line 1, in from models import TRTModule # isort:skip File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\models__init__.py", line 1, in from .engine import EngineBuilder, TRTModule, TRTProfilerV0, TRTProfilerV1 # isort:skip # noqa: E501 File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\models\engine.py", line 7, in import onnx ModuleNotFoundError: No module named 'onnx'

pip install onnx

@ugkjkj
Copy link
Author

ugkjkj commented Jan 12, 2024

(model) C:\Users\15258>pip install onnx
Requirement already satisfied: onnx in d:\anaconda\envs\model\lib\site-packages (1.15.0)
Requirement already satisfied: numpy in d:\anaconda\envs\model\lib\site-packages (from onnx) (1.26.2)
Requirement already satisfied: protobuf>=3.20.2 in d:\anaconda\envs\model\lib\site-packages (from onnx) (4.25.1)

@triple-Mu
Copy link
Owner

python -m pip install onnx

@ugkjkj
Copy link
Author

ugkjkj commented Jan 12, 2024

(model) C:\Users\15258>python -m pip install onnx
Requirement already satisfied: onnx in d:\anaconda\envs\model\lib\site-packages (1.15.0)
Requirement already satisfied: numpy in d:\anaconda\envs\model\lib\site-packages (from onnx) (1.26.2)
Requirement already satisfied: protobuf>=3.20.2 in d:\anaconda\envs\model\lib\site-packages (from onnx) (4.25.1)

@ugkjkj
Copy link
Author

ugkjkj commented Jan 12, 2024

Traceback (most recent call last):
File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\infer-det.py", line 1, in
from models import TRTModule # isort:skip
File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\models_init_.py", line 1, in
from .engine import EngineBuilder, TRTModule, TRTProfilerV0, TRTProfilerV1 # isort:skip # noqa: E501
File "C:\Users\15258\Downloads\YOLOv8-TensorRT-main\YOLOv8-TensorRT-main\models\engine.py", line 7, in
import onnx
ModuleNotFoundError: No module named 'onnx'

@triple-Mu
Copy link
Owner

how about uninstall onnx and install then.

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