AttributeError: module 'tensorflow_core.contrib' has no attribute 'lite'
japita-se opened this issue · comments
On a fresh install:
python3 demo.py
Using TensorFlow backend.
WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
- https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
- https://github.com/tensorflow/addons
- https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.
Traceback (most recent call last):
File "demo.py", line 124, in
mC = motionClassifier()
File "demo.py", line 19, in init
self.interpreter = tf.contrib.lite.Interpreter(model_path=self.model_path)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/lazy_loader.py", line 63, in getattr
return getattr(module, item)
File "/usr/local/lib/python3.7/dist-packages/tensorflow/init.py", line 51, in getattr
return getattr(module, item)
AttributeError: module 'tensorflow_core.contrib' has no attribute 'lite'
I encountered this as well and was able to run it by removing contrib. Instead of self.interpreter = tf.contrib.lite.Interpreter(model_path=self.model_path)
I have self.interpreter = tf.lite.Interpreter(model_path=self.model_path)
.