swook / GazeML

Gaze Estimation using Deep Learning, a Tensorflow-based framework.
MIT License
507 stars 141 forks source link

tensorflow version requirements not defined results in runtime errors #57

Open powersjcb opened 4 years ago

powersjcb commented 4 years ago

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.

Bhartendu-Kumar commented 4 years ago

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

Ankk98 commented 4 years ago

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

Hyrtsi commented 2 years ago

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.