ValueError: Failed to Allocate Tensors - Open MV H7

Question/Issue:
Hi, so I’ve continually been running into the value error ‘Failed to Allocate Tensors’ when attempting to deploy my classification model on my openmv h7 board. I’ve tried multiple attempts at solutions, as listed below, and still am receiving the issue.

Project ID:
524906

Steps Taken:

  1. Initially I uploaded my saved_model.zip to edge impulse, trained it, then deployed it with the openmv firmware option. I tried following the ‘preferred solution’ as listed on this tutorial (https://docs.edgeimpulse.com/docs/run-inference/running-your-impulse-openmv)
  2. When I received the error I looked into the issue and saw that this error could be a result of there being not enough RAM on the board to accommodate the impulse. To note: I also tried both the unoptimised and optimised versions

The optimised version listed the stats below:


Listed here the RAM should be sufficient, however after downloading the zip, the associated binary file exceeds it.

  1. To solve this issue I went back to the original tensor model I uploaded into edge impulse and tried changing/ lessening the convolutional layers so that it would hopefully take up less RAM. However, after retraining and putting it through edge impulse, the accuracy of this new model was significantly worse but Latency, RAM, and flash still remained the same. I also saw online that it may only be the openmv h7 PLUS, that is actually compatible with this deployment method - given the RAM size.

  2. I then tried deploying the model as a openmv library, as seen in the website tutorial linked above. Initially I was hopeful for this method as the ram was listed as 76KB which should work.

But once again I can into the same issue with the error “Exception: Failed to load “trained.tflite”, did you copy the .tflite and labels.txt file onto the mass-storage device? (Failed to allocate tensors)”

For context, I did move the correct files onto the device and tried to restart the openmv IDE to see if that would solve the error. I also tried replugging the board into the computer to see if the files hadn’t properly transferred, but that was not the issue.

I can attach the original model for reference, please let me know :slight_smile:

Thank you!

Environment:

  • Platform: OpenMV H7
  • Build Environment Details: OpenMV IDE Latest
  • OS Version: Windows 11