SRGAN icon indicating copy to clipboard operation
SRGAN copied to clipboard

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

Open chirag-jethvaa opened this issue 4 years ago • 16 comments

Getting this error on the Model function call of get_G

chirag-jethvaa avatar Aug 25 '20 14:08 chirag-jethvaa

which TL version are you using?

zsdonghao avatar Aug 27 '20 09:08 zsdonghao

@zsdonghao 2.2.3

chirag-jethvaa avatar Sep 01 '20 09:09 chirag-jethvaa

@zsdonghao image

chirag-jethvaa avatar Sep 01 '20 09:09 chirag-jethvaa

where did the error from? which line?

zsdonghao avatar Sep 01 '20 09:09 zsdonghao

image

chirag-jethvaa avatar Sep 01 '20 09:09 chirag-jethvaa

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

chirag-jethvaa avatar Sep 01 '20 09:09 chirag-jethvaa

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])

Laicheng0830 avatar Sep 01 '20 10:09 Laicheng0830

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.

manankarani avatar Apr 17 '21 08:04 manankarani

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?

bmittman avatar Jul 28 '21 18:07 bmittman

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 .

chirag-jethvaa avatar Jul 28 '21 18:07 chirag-jethvaa

Tried that, it gives the same error

bmittman avatar Jul 28 '21 18:07 bmittman

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 .

chirag-jethvaa avatar Jul 28 '21 18:07 chirag-jethvaa

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

bmittman avatar Jul 28 '21 18:07 bmittman

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 .

chirag-jethvaa avatar Jul 28 '21 18:07 chirag-jethvaa

@bmittman It is recommended to use python version 3.6.0

Laicheng0830 avatar Jul 29 '21 02:07 Laicheng0830

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

dadajuan avatar Sep 09 '21 06:09 dadajuan