MoRebaie
MoRebaie

Reputation: 23

ImportError: No module named 'yolo_utils'

I downloaded openCV and YOLO weights, in order to implement object detection for a certain project using Python 3.5 version.

when I run this code:

from yolo_utils import read_classes, read_anchors, generate_colors, preprocess_image, draw_boxes, scale_boxes

from yad2k.models.keras_yolo import yolo_head, yolo_boxes_to_corners, preprocess_true_boxes, yolo_loss, yolo_body

The console gives the error below:

ImportError Traceback (most recent call last) in () ----> 1 from yolo_utils import read_classes, read_anchors, generate_colors, preprocess_image, draw_boxes, scale_boxes 2 from yad2k.models.keras_yolo import yolo_head, yolo_boxes_to_corners, preprocess_true_boxes, yolo_loss, yolo_body

ImportError: No module named 'yolo_utils'

Note that i downloaded yolo_utils.py in the weights folder, how can I fix this issue?

Upvotes: 1

Views: 12246

Answers (2)

Gaurav Verma
Gaurav Verma

Reputation: 79

Actually You are Importing user built module. As Yolo_utils is created by a Coursera coordinators to make things easy, this module is available in only their machines and You are trying to import this in your machine. Here is github link of module : https://github.com/JudasDie/deeplearning.ai/blob/master/Convolutional%20Neural%20Networks/week3/yolo_utils.py Save this To your local machine in .py formet And Copy this file in your lib files of Your application(anaconda or any other)

Upvotes: 7

Ashar Fatmi
Ashar Fatmi

Reputation: 34

Copy the source code of yolo_utils .

Paste it in your source code before importing yolo_utils.

It worked for me. Hope this will help..

Upvotes: 1

Related Questions