Giter Site home page Giter Site logo

Comments (10)

per1234 avatar per1234 commented on June 14, 2024

I'm working on getting enough information to be able to investigate this issue in @KXCY-AI's Arduino Forum post about the same:
https://forum.arduino.cc/index.php?topic=709946

Also posted at arduino/ArduinoCore-nRF528x-mbedos#106

from arduinotensorflowlitetutorials.

KXCY-AI avatar KXCY-AI commented on June 14, 2024

I'm working on getting enough information to be able to investigate this issue in @KXCY-AI's Arduino Forum post about the same:
https://forum.arduino.cc/index.php?topic=709946

Also posted at arduino/ArduinoCore-nRF528x-mbedos#106

Thanks per1234, the model runs well after downgrade to 1.1.6

from arduinotensorflowlitetutorials.

gtteixeira avatar gtteixeira commented on June 14, 2024

I am getting the same problem. Follow all the steps with success on training and test model using the colab. No problem. Download the model.h exactly as instructions. Compiled ok.

But when you ask the serial monitor nothing happen. Completely freezing. I am trying to fix during 4 days with no success.

model file and compilation was ok:
image

Freezing when call the serial monitor:
image

I am using tensorflow 2.1.0
image

from arduinotensorflowlitetutorials.

Rainycat avatar Rainycat commented on June 14, 2024

We've hit the exact same problem. Adding some debugging with
Serial.println(), we can see that it never returns from the call to
"new tflite::MicroInterpreter()".

Arduino IDE version is 1.8.13

Arduino BLE 33 board support version is 1.1.6

Tensorflow library version is 2.1.0. ALPHA (IMU_Classifier failed to build against older versions)

Hope this helps someone narrow down the problem!

from arduinotensorflowlitetutorials.

Rainycat avatar Rainycat commented on June 14, 2024

We've hit the exact same problem. Adding some debugging with
Serial.println(), we can see that it never returns from the call to
"new tflite::MicroInterpreter()".

Just to update anyone else who is having this problem, after a lot of faff, we discovered that in MicroAllocator (called by MicroInterpreter instantiation), it checks the supplied arena is 16-byte aligned and errors out if it isn’t. The fix is to declare the arena like this:

byte tensorArena[tensorArenaSize] __attribute__((aligned(16)));

(Although probably the real fix would be within the Arduino_TensorFlowLite
library to not do that check – does it make sense on these platforms?).

Hope this helps :-3

from arduinotensorflowlitetutorials.

ugmurthy avatar ugmurthy commented on June 14, 2024

I have the same problem when i run the classifier on nano33 BLE sense.
The com port is frozen and I cannot upload any new sketch. I restarted nano and also rebooted my laptop. The existing classifier on the nano prevent any new sketches from being loaded onto the nano therefore cannot test the suggestion made by @Rainycat

from arduinotensorflowlitetutorials.

per1234 avatar per1234 commented on June 14, 2024

Hi @ugmurthy. You can recover your board from the Mbed OS crash by:

  1. Press and release the reset button on your board quickly twice. You should now see the "L" LED on the board pulsing, which means the bootloader is running. If you don't see the LED pulsing, you might not have gotten the timing of the button press right, so try again. The double reset causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done).
  2. Select the port of your board from the Tools > Port menu. The port number may be different when the bootloader is running so don't assume you already have the correct port selected.

Now you should be able to upload the sketch to your Arduino board.

from arduinotensorflowlitetutorials.

ugmurthy avatar ugmurthy commented on June 14, 2024

@per1234, Thanks very much. It worked! I struggled with the timing for a while but got. You saved my day.

from arduinotensorflowlitetutorials.

ugmurthy avatar ugmurthy commented on June 14, 2024

We've hit the exact same problem. Adding some debugging with
Serial.println(), we can see that it never returns from the call to
"new tflite::MicroInterpreter()".

Just to update anyone else who is having this problem, after a lot of faff, we discovered that in MicroAllocator (called by MicroInterpreter instantiation), it checks the supplied arena is 16-byte aligned and errors out if it isn’t. The fix is to declare the arena like this:

byte tensorArena[tensorArenaSize] __attribute__((aligned(16)));

(Although probably the real fix would be within the Arduino_TensorFlowLite
library to not do that check – does it make sense on these platforms?).

Hope this helps :-3

Yes that helps - the classifier works! thank you

from arduinotensorflowlitetutorials.

ab-cp avatar ab-cp commented on June 14, 2024

Hi @ugmurthy. You can recover your board from the Mbed OS crash by:

  1. Press and release the reset button on your board quickly twice. You should now see the "L" LED on the board pulsing, which means the bootloader is running. If you don't see the LED pulsing, you might not have gotten the timing of the button press right, so try again. The double reset causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done).
  2. Select the port of your board from the Tools > Port menu. The port number may be different when the bootloader is running so don't assume you already have the correct port selected.

Now you should be able to upload the sketch to your Arduino board.

Both this and 16 bit alignment made the example finally perform as expected!

from arduinotensorflowlitetutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.