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

Error in model prediction: zero-size array to reduction operation maximum which has no identity. Please check the model. #517

Closed
wwmpython opened this issue Jul 12, 2024 · 5 comments
Labels
question Further information is requested

Comments

@wwmpython
Copy link

微信图片_20240712113445
@CVHub520
Copy link
Owner

Hi there! @wwmpython, 😃

Thank you for reporting the issue. To help me diagnose and replicate the problem, could you please package the ONNX file, the configuration file, and a sample image that you're certain the model should be able to predict the target on into a compressed archive?

Please send the compressed package to the following email address for further investigation: cv_hub@163.com. Your assistance in providing these files is crucial for us to resolve the issue. Thank you in advance for your cooperation!

@wwmpython
Copy link
Author

Hi there! @wwmpython, 😃

Thank you for reporting the issue. To help me diagnose and replicate the problem, could you please package the ONNX file, the configuration file, and a sample image that you're certain the model should be able to predict the target on into a compressed archive?

Please send the compressed package to the following email address for further investigation: cv_hub@163.com. Your assistance in providing these files is crucial for us to resolve the issue. Thank you in advance for your cooperation!

ok

@CVHub520
Copy link
Owner

Hey there, @wwmpython! After reviewing the files you provided, I noticed an issue with your ONNX file:

image

It appears there's a mistake that needs correcting. Please re-export your *.pt file using the official YOLOv8 repository. You can follow the guidelines in this tutorial for the export process.

If you continue to experience issues, don't hesitate to reach out for further assistance.

@wwmpython
Copy link
Author

当我按照官方的代码将我的权重文件转换为onnx模型时,出现如下错误:Traceback (most recent call last):
File "F:\wwm\yolov8-pytorch-master\onnx_trans.py", line 10, in
model = YOLO("F:\wwm\yolov8-pytorch-master\model_data\yolov8_s.pt")
File "F:\anaconda3\envs\onnx\lib\site-packages\ultralytics\models\yolo\model.py", line 23, in init
super().init(model=model, task=task, verbose=verbose)
File "F:\anaconda3\envs\onnx\lib\site-packages\ultralytics\engine\model.py", line 149, in init
self._load(model, task=task)
File "F:\anaconda3\envs\onnx\lib\site-packages\ultralytics\engine\model.py", line 230, in _load
self.model, self.ckpt = attempt_load_one_weight(weights)
File "F:\anaconda3\envs\onnx\lib\site-packages\ultralytics\nn\tasks.py", line 857, in attempt_load_one_weight
model = (ckpt.get("ema") or ckpt["model"]).to(device).float() # FP32 model
KeyError: 'model'

进程已结束,退出代码1
飒飒的

@CVHub520
Copy link
Owner

I highly recommend utilizing the official repository (https://github.com/ultralytics/ultralytics) for training and exporting purposes.

Upon reviewing the image you provided, it is evident that you are using a third-party repository, which is not advisable.

If you still have compelling reasons that necessitate using a non-official repository, I urge you to write your own export code to ensure consistency with the official standards.

@CVHub520 CVHub520 added the question Further information is requested label Jul 12, 2024
@CVHub520 CVHub520 closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants