tensorlayer / SRGAN

Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
https://github.com/tensorlayer/tensorlayerx
3.24k stars 813 forks source link

AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike' #214

Open chirag-jethvaa opened 3 years ago

chirag-jethvaa commented 3 years ago

Getting this error on the Model function call of get_G

zsdonghao commented 3 years ago

which TL version are you using?

chirag-jethvaa commented 3 years ago

@zsdonghao 2.2.3

chirag-jethvaa commented 3 years ago

@zsdonghao image

zsdonghao commented 3 years ago

where did the error from? which line?

chirag-jethvaa commented 3 years ago

image

chirag-jethvaa commented 3 years ago

can you specify which version of TensorFlow and tensorlayer you have used?

Laicheng0830 commented 3 years ago

the tensorflow.python.ops, or tf_ops doesn't include _TensorLike attribute in version 2.3.0 or 2.2.0, you can tried downgrading to an older version(tensorflow2.0.0). or modify the code in tensorlayer/models/core.py such that: line 213 if isinstance(check_argu, (tf.Tensor, tf.SparseTensor, tf.Variable)) or tf_ops.is_dense_tensor_like(check_argu): line 222 if not isinstance(check_argu[idx], (tf.Tensor, tf.SparseTensor, tf.Variable)) or not tf_ops.is_dense_tensor_like( check_argu[idx])

manankarani commented 3 years ago

I installed tensorflow version 2.0.0 using pip, and everything worked, had the same error earlier, I was using tensorflow 2.3.0 earlier.

bmittman commented 2 years ago

Getting the same error as above, but changing lines 213 and 222 in tensorlayer/models/core.py as described did not work. I am unable to downgrade TL to version 2.0.0, I get the following error when I try to do so:

ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.6.0rc0, 2.6.0rc1) ERROR: No matching distribution found for tensorflow==2.0.0

Any suggestions?

chirag-jethvaa commented 2 years ago

Try pip install tensorflow==2.0.0

On Wed, 28 Jul, 2021, 23:31 bmittman, @.***> wrote:

Getting the same error as above, but changing lines 213 and 222 in tensorlayer/models/core.py as described did not work. I am unable to downgrade TL to version 2.0.0, I get the following error when I try to do so:

ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.6.0rc0, 2.6.0rc1) ERROR: No matching distribution found for tensorflow==2.0.0

Any suggestions?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tensorlayer/srgan/issues/214#issuecomment-888509903, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPR3RRK76MTWVNQSZYK253T2BAX3ANCNFSM4QKV3GEQ .

bmittman commented 2 years ago

Tried that, it gives the same error

chirag-jethvaa commented 2 years ago

Share the line which produces this error

On Wed, 28 Jul, 2021, 23:38 bmittman, @.***> wrote:

Tried that, it gives the same error

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tensorlayer/srgan/issues/214#issuecomment-888514329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPR3RRNYXDQQWOYMQPOOI3T2BBTJANCNFSM4QKV3GEQ .

bmittman commented 2 years ago

pip install tensorflow==2.0.0 gives the following error:

"ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.6.0rc0, 2.6.0rc1) ERROR: No matching distribution found for tensorflow==2.0.0"

pip3 install tensorflow==2.0.0 gives the same error

I'm using Python 3.9.5

chirag-jethvaa commented 2 years ago

I would suggest you make a new environment.. and install tensorflow again

On Wed, 28 Jul, 2021, 23:43 bmittman, @.***> wrote:

pip install tensorflow==2.0.0 gives the following error:

"ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.6.0rc0, 2.6.0rc1) ERROR: No matching distribution found for tensorflow==2.0.0"

pip3 install tensorflow==2.0.0 gives the same error

I'm using Python 3.9.5

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tensorlayer/srgan/issues/214#issuecomment-888517400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPR3RUBNRKGCJMYRKFKLYTT2BCFVANCNFSM4QKV3GEQ .

Laicheng0830 commented 2 years ago

@bmittman It is recommended to use python version 3.6.0

dadajuan commented 2 years ago

image my tensorflow's version is 2.0.0 and my tensorlayer ==2.0.0 . why this wrong happens?