ModuleNotFoundError : No module named 'models'

Viewed 252

I am performing YOLOv5 deep learning algorithm. I have cloned repo, installed dependencies and assembled the data using roboflow. While training custom YOLOv5 model I met with the following error.

!python train.py --img 416 --batch 16 --epochs 150 --data {dataset.location}/data.yaml --weights yolov5s.pt --cache*

Traceback (most recent call last): File "C:\Users\nived\Untitled Folder 1\train.py", line 40, in import models ModuleNotFoundError: No module named 'models'

1 Answers

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

Related