Skip to content

[MKC-667]benjamindannegard/nano33 TF tutorial update #556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

BenjaminDannegard
Copy link
Contributor

What This PR Changes

  • Updated Tensorflow tutorial since the library was removed from our library manager

Contribution Guidelines

@gatsby-cloud
Copy link

gatsby-cloud bot commented Sep 23, 2022

✅ docs-content deploy preview ready

@karlsoderby karlsoderby changed the title benjamindannegard/nano33 TF tutorial update [MKC-667]benjamindannegard/nano33 TF tutorial update Sep 27, 2022
…t-started-with-machine-learning/get-started-with-machine-learning.md


Added a note stating that this tutorial works with a specific version of the TF library
@karlsoderby karlsoderby self-requested a review September 27, 2022 07:58
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IMU Classifier sketch at the end of the tutorial fails to compile when using the updated library version:

C:\Users\per\Documents\Arduino\IMUClassifier\IMUClassifier.ino:23:10: fatal error: tensorflow/lite/version.h: No such file or directory
 #include <tensorflow/lite/version.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: tensorflow/lite/version.h: No such file or directory

As you can see, the library does not contain this file:

https://github.com/tensorflow/tflite-micro-arduino-examples/tree/4056e5f13aafb4dd3eda46cec273133a1d5e9593/src/tensorflow/lite

I also found there is a problem with the "Setup Python Environment" step of the Jupyter notebook:

ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0-rc1 (from versions: 1.13.1, 1.13.2, 1.14.0, 1.15.0, 1.15.2, 1.15.3, 1.15.4, 1.15.5, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.0+zzzcolab20220506153740, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.4+zzzcolab20220516125453, 2.6.5, 2.6.5+zzzcolab20220523104206, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.0+zzzcolab20220506150900, 2.7.1, 2.7.2, 2.7.2+zzzcolab20220516114640, 2.7.3, 2.7.3+zzzcolab20220523111007, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.0+zzzcolab20220506162203, 2.8.1, 2.8.1+zzzcolab20220516111314, 2.8.1+zzzcolab20220518083849, 2.8.2, 2.8.2+zzzcolab20220523105045, 2.8.2+zzzcolab20220527125636, 2.8.2+zzzcolab20220629235552, 2.8.2+zzzcolab20220714152931, 2.8.2+zzzcolab20220714162028, 2.8.2+zzzcolab20220719082949, 2.8.2+zzzcolab20220822160911, 2.8.3, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0)
ERROR: No matching distribution found for tensorflow==2.0.0-rc1

BenjaminDannegard and others added 2 commits September 27, 2022 14:03
…t-started-with-machine-learning/get-started-with-machine-learning.md

Co-authored-by: per1234 <[email protected]>
…t-started-with-machine-learning/get-started-with-machine-learning.md

Co-authored-by: per1234 <[email protected]>
@karlsoderby
Copy link
Contributor

@BenjaminDannegard can you take a look at the comments from Per and test it out and adjust the content?

@BenjaminDannegard
Copy link
Contributor Author

The IMU Classifier sketch at the end of the tutorial fails to compile when using the updated library version:

C:\Users\per\Documents\Arduino\IMUClassifier\IMUClassifier.ino:23:10: fatal error: tensorflow/lite/version.h: No such file or directory
 #include <tensorflow/lite/version.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: tensorflow/lite/version.h: No such file or directory

As you can see, the library does not contain this file:

https://github.com/tensorflow/tflite-micro-arduino-examples/tree/4056e5f13aafb4dd3eda46cec273133a1d5e9593/src/tensorflow/lite

I also found there is a problem with the "Setup Python Environment" step of the Jupyter notebook:

ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0-rc1 (from versions: 1.13.1, 1.13.2, 1.14.0, 1.15.0, 1.15.2, 1.15.3, 1.15.4, 1.15.5, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.0+zzzcolab20220506153740, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.4+zzzcolab20220516125453, 2.6.5, 2.6.5+zzzcolab20220523104206, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.0+zzzcolab20220506150900, 2.7.1, 2.7.2, 2.7.2+zzzcolab20220516114640, 2.7.3, 2.7.3+zzzcolab20220523111007, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.0+zzzcolab20220506162203, 2.8.1, 2.8.1+zzzcolab20220516111314, 2.8.1+zzzcolab20220518083849, 2.8.2, 2.8.2+zzzcolab20220523105045, 2.8.2+zzzcolab20220527125636, 2.8.2+zzzcolab20220629235552, 2.8.2+zzzcolab20220714152931, 2.8.2+zzzcolab20220714162028, 2.8.2+zzzcolab20220719082949, 2.8.2+zzzcolab20220822160911, 2.8.3, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0)
ERROR: No matching distribution found for tensorflow==2.0.0-rc1

@per1234 could we get in contact with the Tensorflow people and ask them if they can take a look at the library issue and fix it on their end? Do you know anyone over there we could talk to about this?

@per1234
Copy link
Contributor

per1234 commented Oct 3, 2022

Hi @BenjaminDannegard. I don't know anyone involved with the TensorFlow project. I only received the library removal request from them as part of my duties maintaining the Arduino Library Manager index as a whole.

@karlsoderby
Copy link
Contributor

@BenjaminDannegard can you make a copy of the now incorrect example, and then remove it from the article for now? Like we discussed earlier.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This strategy of removing content instead of fixing it doesn't work.

The removed parts are essential components of the tutorial. With the removed parts, everything from the "Training a TensorFlow Lite Micro Model For Arduino" onward is nonsensical because it was all leading up to the culmination of the tutorial in the "Classifying IMU Data" section.

I'm confident that it will not be at all difficult to update the content. It is a very interesting and well written tutorial and I think performing the update would be a very enjoyable assignment.

@UniversalGeneve1
Copy link

@BenjaminDannegard I manually added in version.h which I got from here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/public/version.h

and my project compiled. if you're looking for some quick and dirty fix this may work for you.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a reminder here that there is now an additional copy of this content for the Nano 33 BLE Sense Rev2:

https://github.com/arduino/docs-content/blob/main/content/hardware/03.nano/boards/nano-33-ble-sense-rev2/tutorials/get-started-with-machine-learning/get-started-with-machine-learning.md

While the adjustments to the content are still in progress, it makes sense to work in only one of the two tutorials, but once the content adjustments are finalized in the Nano 33 BLE Sense version of the tutorial, they must also be applied to the Nano 33 BLE Sense Rev2 tutorial.

@jhansson-ard jhansson-ard added maker arduino Bugs and fixes added by the Arduino Team labels Apr 20, 2023
@jhansson-ard
Copy link
Contributor

@BenjaminDannegard @karlsoderby what is the status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arduino Bugs and fixes added by the Arduino Team maker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants