-
Notifications
You must be signed in to change notification settings - Fork 2
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
I have trained my data. But it doesn't work with your code. #4
Comments
This is because the new and old versions of YOLOv5 are incompatible, and the yolo.py file under models is missing the DetectionModel module code. It is recommended that you make changes in the model by comparing the latest Yolo source code as following URL: https://blog.csdn.net/weixin_46389664/article/details/129306692 |
@WoodratTradeCo |
@WoodratTradeCo I can train my data from your code? how do you configure I tried training from your file and it crashes. D:\UAV\project-crop-row>python train.py --img 640 --batch 8 --epochs 100 --data config.yaml --weights yolov5.pt --workers 4 --cache --device 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): |
❔Question
I have trained my data. But it doesn't work with your code.
Additional context
PS D:\project-crop-row> python detect.py --img 320 --weights cropbest.pt --source "test1.mp4" --conf 0.4
Traceback (most recent call last):
File "D:\project-crop-row\detect.py", line 358, in
detect()
File "D:\project-crop-row\detect.py", line 63, in detect
model = attempt_load(weights, map_location=device) # load FP32 model
File "D:\project-crop-row\models\experimental.py", line 118, in attempt_load
ckpt = torch.load(w, map_location=map_location) # load
File "C:\Users\NITRO\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 712, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "C:\Users\NITRO\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 1049, in _load
result = unpickler.load()
File "C:\Users\NITRO\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 1042, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'DetectionModel' on <module 'models.yolo' from 'D:\project-crop-row\models\yolo.py'>
The text was updated successfully, but these errors were encountered: