GazeML icon indicating copy to clipboard operation
GazeML copied to clipboard

tensorflow version requirements not defined results in runtime errors

Open powersjcb opened this issue 5 years ago • 3 comments

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.

powersjcb avatar Jan 29 '20 20:01 powersjcb

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 avatar Apr 18 '20 15:04 Bhartendu-Kumar

@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.

Ankk98 avatar May 20 '20 18:05 Ankk98

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.

Hyrtsi avatar Apr 12 '22 07:04 Hyrtsi