Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Using tensorflow in python

+2 votes
Hello,

I followed the Jevois tutorial to train imagenet on new classifiers, and generated the tflite file, but I was wondering now if it is possible to use this model  in a python module. The tutorial explains how to deploy the tflite model to the tensorfloweasy module, but I would prefer to do this from within a python module. I tried to import tensorflow in a python module, but tensorflow was not found. I also tried to install a few different wheels for tensorflow on the camera, but this just caused the camera to crash. Overall, I am just wondering if it is possible to use the tensorflow library in a python module, rather than a C++ module like tensorfloweasy
asked Apr 23, 2020 in Programmer Questions by obriena (310 points)
recategorized Apr 23, 2020 by obriena

1 Answer

+1 vote
This is not supported, though you should be able to run your model using Python OpenCV, see for example

http://jevois.org/moddoc/PyClassificationDNN/modinfo.html

http://jevois.org/moddoc/PyDetectionDNN/modinfo.html

Unfortunately cross-compiling TF is becoming increasingly difficult because of their bazel build system, but we will look into whether we could compile the python bindings into our TF module.
answered Jun 24, 2020 by JeVois (46,580 points)
Thanks for the information. Shortly after posting this question I did find how to read the model using opencv. I appreciate you taking the time to look into the python bindings.
obriena - were you somehow able to use OpenCV DNN to load a TFLite model?   I thought that OpenCV DNN does not support TFLite.  Or did you convert your model to another framework?  Thank you.
...