System information
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Raspberry Pi 3B+ (latest dist)
TensorFlow installed from (source or binary): pip
TensorFlow version (or github SHA if from source): 1.11.0 (latest from pip)
Keras version: 2.2.4 (latest from pip)
Hello,
I am trying to accelerate a CNN model in order to run it in python and on my raspberry pi. I've tried using tensorflow lite as a solution to this but I still have no success in converting my keras model to a lite one and use it afterwards. I've tried tflite_convert on the command line but I get the error quoted below. I've also tried using the TocoConverter inside python and also using the TFLiteConverter and tflite_convert on a machine with fully updated tensorflow and keras but I still get the same error. Could you help me?
Provide the text output from tflite_convert
raise TypeError('Keyword argument not understood:' , kwarg)
TypeError: ('Keyword argument not understood:' , u'output_padding')
Related
I am trying to solve the issue but was not able since a month .
I do need your help to find out what is not working in order to move forward with my project.
I am trying to implement an LSTM model to predict temperature and humidity but the output is giving me 0 after all efforts
I have used xxd to convert my tflite model to en h file since the tinymlgen kept giving me error.
libraries for model in colab:
Python 3.7.15
TF version: 2.9.2
Keras: 2.9.0
Numpy: 1.21.6
Pandas: 1.3.5
implementation librairy:
Arduino IDE 2.0.0
EloquentTinyML version 2.4.3
ESP 32 (dev module board)
please help me find a solution
below the link of the project :
https://github.com/koulnodji6056/Prediction_LSTM_model_EloquentTinyML_library
During the conversion in tflite format, some errors occur"antrusted wone though I was able to convert it but still not possible to use Tmymlgn.
I really wont to move foreward with my project
I have developed a deep learning model with the Keras, a while ago and do not remember the version of Keras and Tensorflow which I used. Now, I have created a Kivy app that uses that model. The problem is that when I try to use the app on my ubuntu device, which has python 3.8, Keras 2.5.0, and Tensorflow 2.5.0, the app works perfectly. But, when I try to use the app on my device which exploits Windows 10, using python 3.8, Keras 2.5.0, and Tensorflow 2.5.0, It fails and raises the error: "bad marshal data(unknown code type)". The reason that I use python 3.7 on windows 10 is that I want to create a .exe file out of my project and pyinstaller does not work properly with python 3.8.
How can I fix the problem? I will appreciate your kind answers since I'm struggling with this issue for about a month.
I have been getting multiple errors which are due to conflicts in the TensorFlow version installed in my system and the version used to write the code in Tensorflow API.
I am using python 3.6.7 and Tensorflow 2.0 to get started with the code https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/installation.md
But I am getting several errors :
flags = tf.app.flags
AttributeError: module 'tensorflow' has no attribute 'app.
As I am using 2.0 , I replaced tf.app.flags with tf.compat.v1.flags.
from tensorflow.contrib import slim as contrib_slim
ModuleNotFoundError: No module named 'tensorflow.contrib'
I am not able to solve the second one.
Can I get help to know which python and tensorflow version should be used to run DeepLab v3+?
You should use the Tensorflow version 1.x to run the DeepLabV3+ model because it uses a session to run and also the slim library which is based on the TensorFlow 1.x. And so your two problems can be solved as:
Do not need to replace tf.app.flags with tf.compat.v1.flags.
To run DeepLabV3+ model, you need to put deeplab and slim folder in a folder (deeplab_slim),
and export them by running following export commands from this parent folder (deeplab_slim):
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/deeplab
I just want to run my model for deep learning with keras on MacOS
But It's not working
So I already install plaidml below
and I switched 'metal_amd_radeon_pro_560x.0' in plaidml-setup
after that, I added 'os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"' in pycharm
but I check gpu activity is low.
and I tried to do another method 'multi_gpu_model' in keras
But I got also error message 'However this machine only has: ['/cpu:0']'
my mac is 2019 macbook pro with Radeon Pro 560X 4 GB graphic card
could you help me for it?
Please follows these steps (assuming you have python already installed),
virtualenv plaidml
source plaidml/bin/activate
pip install plaidml-keras plaidbench
Choose the accelerator
plaidml-setup
Set Keras as backend
os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
In development, I have been using the gpu-accelerated tensorflow
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.1-cp35-cp35m-linux_x86_64.whl
I am attempting to deploy my trained model along with an application binary for my users. I compile using PyInstaller (3.3.dev0+f0df2d2bb) on python 3.5.2 to create my application into a binary for my users.
For deployment, I install the cpu version, https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp35-cp35m-linux_x86_64.whl
However, upon successful compilation, I run my program and receive the infamous tensorflow cuda error:
tensorflow.python.framework.errors_impl.NotFoundError:
tensorflow/contrib/util/tensorflow/contrib/cudnn_rnn/python/ops/_cudnn_rnn_ops.so:
cannot open shared object file: No such file or directory
why is it looking for cuda when I've only got the cpu version installed? (Let alone the fact that I'm still on my development machine with cuda, so it should find it anyway. I can use tensorflow-gpu/cuda fine in uncompiled scripts. But this is irrelevant because deployment machines won't have cuda)
My first thought was that somehow I'm importing the wrong tensorflow, but I've not only used pip uninstall tensorflow-gpu but then I also went to delete the tensorflow-gpu in /usr/local/lib/python3.5/dist-packages/
Any ideas what could be happening? Maybe I need to start using a virtual-env..