Hi there,
I created a TFLite model using Edge Impulse. I successfully loaded the model onto my new Portenta H7 (after loading OpenMV’s firmware successfully), and when I run the micropython script I see the board’s camera feed for a few seconds – until suddenly it gets stuck and I receive OSError: 16
.
Any ideas what might be going on here?
What line is throwing that error?
It’s a popup window, that’s all the window says with no further explanation. How might I go about getting a traceback for this error?
Hello W. Agyeman
The error showed up during the implementation of the I2C interface. It was finally a Hardware problem with a bad connection. No it works.
Thanks for asking.
Mit freundlichen Grüssen
Kind Regards
Balz Heusler
I’m confused… you seem to be responding as if you opened this topic, but my problem still persists.
I thought you were the same person. Please post the script + tflite file, which cam, firmware version and any other details and we’ll test it.
Thanks for the reply!
-
First of all, here is a link to the requested files (as they were exported from Edge Impulse).
-
I’m using an Arduino Portenta H7 with the LoRa Vision Shield.
-
According to OpenMV my device’s firmware is 3.6.8.
Happy to provide any further details needed! Thank you.
I’m now seeing that the error is being thrown at line 12, where the script attempts to access the labels.txt file. The file exists in the same folder as the script, so I’m not sure why it is having trouble finding it… (if that is the problem)
I tried an additional test and received a different error:
Instead of trying to access labels.txt, I wrote in the labels as a list. The script managed to pass line 12 without issue.
But now it is getting stuck at line 21:
for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
Where it is throwing the following error:
OSError: The physical drive cannot work
Before I can test this you have to upgrade to the latest firmware first, 4.0.0 and then test it again and if the problem still persists let us know. (Please make sure to check the Erase filesystem box when upgrading the fw, if you use the internal flash storage).
Hi, thanks. It automatically uploads the 3.6.8 when I click “Reset firmware to release version”. I’m happy to try and load a specific file – could you direct me to where I can find the 4.0.0 firmware file?
Edit: OpenCV is telling me that 3.6.8 is [latest]…
IDE resources are outdated, the latest release is here: https://github.com/openmv/openmv/releases/download/v4.0.0/firmware_v4.0.0.zip
Upload firmware/PORTENTA/firmware.bin
Looks like I had foolishly ignored the message telling me to update the IDE’s resources.
I updated them and flashed 4.0.0 to my device (erasing filesystem as you suggested). I replaced the script and model and now I am receiving an error on line 5:
sensor.reset()
Error:
OSError: Reset Failed
(This is after multiple attempts including reuploading the firmware, reconnecting the device physically, restarting OpenMV…)
Yes sometimes I get this too, it just needs a power cycle.
Indeed!
Power cycled the device (unplugged and held down button for 30 sec) and it managed to run the script!
Thank you for your help thusfar – if you still have energy to help more, I’m getting a sort of “roll” effect on my camera buffer display… The image is smooth for 2 sec (or however long I define sensor.skip_frames(time=...)
to be), but once the while
loop starts, the image gets very choppy.
Have you run into this issue in the past?
EDIT: Example video available here.
Yes I see the issue, looks related to double buffering that was recently implemented… for now you can just disable it with:
sensor.set_framebuffers(1)
@kwagyeman You should see this.
Best support ever!
This fixed the problem. Thank you so much for all the help.
I can also reproduce the bug on other cams likely memory issue we’ll work on fixing it for the next release. FWIW double buffering works (triple is broken):
sensor.set_framebuffers(2)