Skip to content

Error while using exported .pb model #10626

Answered by alijafari79
Karshiev asked this question in Q&A
Discussion options

You must be logged in to vote

Recently I trained yolov5x model to detect fruits and vegetables dataset. After converting the trained yolov5x.pt file into .pb file, I loaded the .pb model and tried to get classes and detected objects with the following code:

**import skimage.io
model_path = r'path_to_.pb_model'
loaded_model = tf.saved_model.load(model_path)
IMAGE_PATH = r'./test_image.jpg'
image = skimage.io.imread(IMAGE_PATH, as_gray=False)
image_expanded = np.expand_dims(image, axis=0)
output = loaded_model(image_expanded)
boxes = np.squeeze(output['detection_boxes'])**

I had following issue:

Traceback (most recent call last): File "test_pb.py", line 38, in boxes = np.squeeze(output['detection_boxes']) TypeError: l…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@alijafari79
Comment options

Answer selected by Karshiev
Comment options

You must be logged in to vote
2 replies
@Karshiev
Comment options

@Karshiev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants