Closed hzhoanglee closed 3 years ago
Please paste your entire code here and tell me which line occurs this error so that I can help you
by the way, what's the filetype of model trained by Teachable machine?
I got this error:
Traceback (most recent call last):
File "/home/control/Downloads/TensorFlow-Lite-Object-Detection-and-Image-Classification-on-Jetson-Nano-master (1)/object_detection_and_image_classification.py", line 160, in <module>
classes = interpreter.get_tensor(output_details[1]['index'])[0] # Class index of detected objects
IndexError: list index out of range
GST_ARGUS: Cleaning up
I also attached the model trained by Teachable Machine below. Can you guide me to a guide where I can train my own model or convert it? Thanks. converted_tflite.zip
I think you should change your labels.txt from
0 Haylou
1 AirPods
2 TicC2
to
Haylou
AirPods
TicC2
and be sure to use code editor instead of Microsoft Notepad due to the encoding problem.
Then try execute the code again, and see if it works.
Tried that but same error occurred. I think it the issue of compatibility. May I ask that did you trained your model?
File "object_detection_and_image_classification.py", line 160, in <module> classes = interpreter.get_tensor(output_details[1]['index'])[0] # Class index of detected objects IndexError: list index out of range GST_ARGUS: Cleaning up
Tried that but same error occurred. I think it the issue of compatibility. May I ask that did you trained your model?
File "object_detection_and_image_classification.py", line 160, in <module> classes = interpreter.get_tensor(output_details[1]['index'])[0] # Class index of detected objects IndexError: list index out of range GST_ARGUS: Cleaning up
I trained my model from GoogleAutoML instead of TeachableMachine
I think you could change the following code from
innterpreter.get_tensor(output_details[1]['index'])[0]
to
innterpreter.get_tensor(output_details[0]['index'])[0]
and see if it works
Re-Trained by Google AutoML from Google Cloud Platform, everything works flawlessly.
I am having an issue with model trained by Teachable machine. The sample model worked fine but when I load my own model and run the app, I got this issue:
IndexError: list index out of range
Can you help me please, thanks.