Traceback (most recent call last):
File "C:/projects/YOLOV5/yolov5/train.py", line 412, in
train(hyp)
File "C:/projects/YOLOV5/yolov5/train.py", line 88, in train
model.load_state_dict(torch.load(new_weights))
File "C:Python36libsite-packagestorchserialization.py", line 368, in load
return _load(f, map_location, pickle_module)
File "C:Python36libsite-packagestorchserialization.py", line 542, in _load
result = unpickler.load()
ModuleNotFoundError: No module named 'models.yolo'
Hello @tangxiaochu123230, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook , Docker Image, and Google Cloud Quickstart Guide for example environments.
If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
If this is a custom model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com.
@tangxiaochu123230 please provide minimum viable code to reproduce your issue, otherwise we can not help you.
I solved the problem by add __init__.py to models folder
@tangxiaochu123230 perfect. This has already been done in a commit recently. Pleasee update your repo with git pull or reclone.
I solved the problem by add init.py to models folder
I have added the __init__.py (empty file) to the models folder, but still I get the error no module named 'models.yolo'
Most helpful comment
I have added the __init__.py (empty file) to the models folder, but still I get the error no module named 'models.yolo'