GazeML
GazeML copied to clipboard
tensorflow version requirements not defined results in runtime errors
AttributeError: module 'tensorflow' has no attribute 'Session'
It looks like there have been breaking changes in the tensorflow API.
While python setup.py install
might not be the optimal way to install tensorflow, there's currently no check ensuring a compatible version of tensorflow is installed.
Yes, the use case of Session() in tenserflow.Session() has been changed from 1.x to 2.x. So, either degrade to tenserflow 1.x or use :
import tensorflow.compat.v1 as tf tf.disable_v2_behavior()
https://stackoverflow.com/questions/55142951/tensorflow-2-0-attributeerror-module-tensorflow-has-no-attribute-session
@Bhartendu-Kumar One need to add those lines to almost all files in src to make it work. It would be better to include TensorFlow v1 in requirements/setup.py so that to respect the time and data of people.
Just create a .venv
with tf 1.15 and it works. I didn't get it working with tf2 but if you must do it, you have to replace all tf1 calls with tf1 compatibility ones. Quite burdensome so using tf1.x was the trick for me.