Getting an IndexError from the tflite backend on Raspberry Pi
See original GitHub issueTraceback (most recent call last):
File "/home/pi/Desktop/tester.py", line 6, in <module>
result = model.predict_from_file('/home/pi/Desktop/image.png')
File "/home/pi/.local/lib/python3.7/site-packages/lobe/ImageModel.py", line 43, in predict_from_file
return self.predict(image_utils.get_image_from_file(path))
File "/home/pi/.local/lib/python3.7/site-packages/lobe/ImageModel.py", line 47, in predict
return self.__backend.predict(image_processed)
File "/home/pi/.local/lib/python3.7/site-packages/lobe/backends/_backend_tflite.py", line 57, in predict
output_details[1]["index"]
IndexError: list index out of range
Here is my code:
from lobe import ImageModel
model = ImageModel.load('/home/pi/Lobe/model')
result = model.predict_from_file('/home/pi/Desktop/image.png')
print(result.prediction)
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
IndexError: list index out of range on Python code
But I am getting an error saying IndexError: list index out of range and I don't know where to go from here. Code:...
Read more >Model Maker TF Lite Slow Inference - TensorFlow Forum
My end goal will be to run on a device like an raspberry pi 4, jetson nano or something similar (min 4 CPUs,...
Read more >How to Perform Object Detection with TensorFlow Lite on ...
In this tutorial, I'll walk you through the process of installing TensorFlow Lite on a Raspberry Pi and using it to perform object...
Read more >How to install Tensorflow in Raspberry pi 4b 8gb , i am aslo try ...
TensorFlow Lite with Python is great for embedded devices based on Linux, such as Raspberry Pi. python3 -m pip install tflite-runtime.
Read more >How to Run TensorFlow Lite Models on Raspberry Pi
Accessing Raspberry Pi from PC; Preparing TFLite in RPi; Downloading MobileNet; Classifying a Single Image. Let's get started. Bring this project to life....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for the delay, turned into a larger refactor than anticipated! Here is the PR, would love to get some help testing in your cases: https://github.com/lobe/lobe-python/pull/15
I’m taking a look at this now and refactoring a bit how models are loaded and run. Should have a branch up later this evening that would be great to get some testing help.