I attempted to convert the model using ultralytics 8.0.86, torch 1.8.0, and onnx 1.8.0, and when I tried to convert the .pt file to onnx, I encountered the following error:
(yolov8_env) ss@ss-System-Product-Name:~/yolov8_env$ python3 export1.py
WARNING ⚠️ yolov8n-pose.pt appears to require 'ultralytics.nn.modules.conv', which is not in ultralytics requirements.
AutoInstall will run now for 'ultralytics.nn.modules.conv' but this feature will be removed in the future.
Recommend fixes are to train a new model using the latest 'ultralytics' package or to run a command with an official YOLOv8 model, i.e. 'yolo predict model=yolov8n.pt'
requirements: YOLOv8 requirement "ultralytics.nn.modules.conv" not found, attempting AutoUpdate...
ERROR: Could not find a version that satisfies the requirement ultralytics.nn.modules.conv (from versions: none)
ERROR: No matching distribution found for ultralytics.nn.modules.conv
requirements: ❌ Command 'pip install --no-cache "ultralytics.nn.modules.conv" ' returned non-zero exit status 1.
Traceback (most recent call last):
File "export1.py", line 2, in <module>
model = YOLO("yolov8n-pose.pt")
File "/home/ss/yolov8_env/lib/python3.8/site-packages/ultralytics/yolo/engine/model.py", line 107, in __init__
self._load(model, task)
File "/home/ss/yolov8_env/lib/python3.8/site-packages/ultralytics/yolo/engine/model.py", line 156, in _load
self.model, self.ckpt = attempt_load_one_weight(weights)
File "/home/ss/yolov8_env/lib/python3.8/site-packages/ultralytics/nn/tasks.py", line 419, in attempt_load_one_weight
ckpt, weight = torch_safe_load(weight) # load ckpt
File "/home/ss/yolov8_env/lib/python3.8/site-packages/ultralytics/nn/tasks.py", line 374, in torch_safe_load
return torch.load(file, map_location='cpu'), file # load
File "/home/ss/yolov8_env/lib/python3.8/site-packages/torch/serialization.py", line 592, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/home/ss/yolov8_env/lib/python3.8/site-packages/torch/serialization.py", line 851, in _load
result = unpickler.load()
ModuleNotFoundError: No module named 'ultralytics.nn.modules.conv'; 'ultralytics.nn.modules' is not a package
Due to this error, I modified the yaml file. Could this process cause any issues?
I’m trying it, but it’s not going well. Could you provide the YOLOv8n pose model you used for the conversion?
I’m curious about the versions. I would like to know the versions of ultralytics, YOLOv8n pose model, and ONNX that were used for the conversion.
First, when I converted to onnx in version 8.0.86, I got that error by using the model that was automatically downloaded with the code above, so I converted the yaml file. @Louis-Cheng-Liu