-
Notifications
You must be signed in to change notification settings - Fork 68
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
export yolov8-lite-s and yolov8-lite-t error #9
Comments
hi, [pcb9382] 我也尝试导出模型到ONNX 1. AttributeError: Can't get attribute 'StemBlock' on <module 'ultralytics.nn.modules' from '/home/pcb/.local/lib/python3.8/site-packages/ultralytics/nn/modules/init.py'> 在作者自己的ultralytics里是有StemBlock这个函数得,但导出时我们安装使用是官方的包 来自于 命令“pip install ultralytics” 解决办法:
|
I want to export the model as onnx opset 11 I succeeded, and all the steps to try are as follows:
export.pyfrom ultralytics import YOLO model = YOLO("xxx/yolov8n-face.pt") |
yolo mode=export model=yolov8-lite-s.pt format=onnx simplify=True batch=1
Traceback (most recent call last):
File "/home/pcb/.local/bin/yolo", line 8, in
sys.exit(entrypoint())
File "/home/pcb/.local/lib/python3.8/site-packages/ultralytics/yolo/cfg/init.py", line 378, in entrypoint
model = YOLO(model, task=task)
File "/home/pcb/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/model.py", line 107, in init
self._load(model, task)
File "/home/pcb/.local/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/pcb/.local/lib/python3.8/site-packages/ultralytics/nn/tasks.py", line 578, in attempt_load_one_weight
ckpt, weight = torch_safe_load(weight) # load ckpt
File "/home/pcb/.local/lib/python3.8/site-packages/ultralytics/nn/tasks.py", line 518, in torch_safe_load
return torch.load(file, map_location='cpu'), file # load
File "/home/pcb/.local/lib/python3.8/site-packages/torch/serialization.py", line 607, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/home/pcb/.local/lib/python3.8/site-packages/torch/serialization.py", line 882, in _load
result = unpickler.load()
File "/home/pcb/.local/lib/python3.8/site-packages/torch/serialization.py", line 875, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'StemBlock' on <module 'ultralytics.nn.modules' from '/home/pcb/.local/lib/python3.8/site-packages/ultralytics/nn/modules/init.py'>
The text was updated successfully, but these errors were encountered: