I'm using YOLOv5, clone from its official github repo.
During the training I got the following error:
Traceback (most recent call last):
File "C:\Users\nived\Untitled Folder 1\train.py", line 40, in <module>
import models
ModuleNotFoundError: No module named 'models'
Train command:
!python train.py --img 416 --batch 16 --epochs 150 --data relative/path/to/data.yaml --weights yolov5s.pt --cache*
Please add mentioned code in the top two lines of the detect.py file and it will work then,
import sys
sys.path.insert(0, './yolov5')
For more details, you can visit link from YOLOv5 Repository
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With