Error while using exported .pb model #10626
Replies: 2 comments 3 replies
-
Hi @Karshiev,I got what you say and let's do it this way to get the keys you need :) First let's see how the model organizes the keys .... At this step load the model :
Then, Let's see the keys using signatures :
Imported signatures always return dictionaries. Then for the output of the last command you may see the keys of the model signature e.g :
Now for the rest of the code, I think the solution is to give the "loaded_model" the input data and then see the "signatures" of the "output" that will be a dictionary and will shed light on what you may look for in the future : The rest of the code like you wrote :
but a change here to see the keys of the output :
and you may see the result that you look for :) Dear @Karshiev , if you found my answer useful Mark it as answer ! |
Beta Was this translation helpful? Give feedback.
-
Did the solution above work for you ?? |
Beta Was this translation helpful? Give feedback.
-
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:
I had following issue:
Traceback (most recent call last):
File "test_pb.py", line 38, in
boxes = np.squeeze(output['detection_boxes'])
TypeError: list indices must be integers or slices, not str
It seems the output is "list", but it must be dictionary.
I am new to yolov5, Can you please help me?
Beta Was this translation helpful? Give feedback.
All reactions