tensorrec icon indicating copy to clipboard operation
tensorrec copied to clipboard

Error - tensorflow has no attribute`get_default_session()`

Open lxin618 opened this issue 5 years ago • 3 comments

Hi there, just installed the tensorrec package, tried to run the script, i got the error: if tf.get_default_session() is not None: AttributeError: module 'tensorflow' has no attribute 'get_default_session' , in session_managment file, searched online, couldn't find anything, just posted here, wondering if i can please get some help.. python version: 3.7.8, tensorflow: 2.2.0, tensorrec: 0.26.2, Keras: 2.1.4 thank you so much

lxin618 avatar Sep 19 '20 09:09 lxin618

try this

import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

abhiHunts avatar Jan 22 '21 17:01 abhiHunts

i fixed it as below:

https://github.com/wisonwang/tensorrec/commit/590c7f63b42bdeb9c0b5be43759ee3a10844cdf1

refrence : migrate tf1->tf2

wisonwang avatar Mar 17 '21 09:03 wisonwang

@https://github.com/wisonwang, Was this merged already? Does a package exist?

related to: https://github.com/jfkirk/tensorrec/issues/163

ChrisDelClea avatar Jan 20 '22 16:01 ChrisDelClea