tensor2tensor icon indicating copy to clipboard operation
tensor2tensor copied to clipboard

AttributeError: module 'tensorflow' has no attribute 'contrib'

Open newmluser opened this issue 7 years ago • 4 comments

Description

Error when importing problems. ...

Environment information

OS:  Windows10
$ pip freeze | grep tensor
mesh-tensorflow==0.0.5
tensor2tensor==1.14.0
tensor2tensor==1.14.0
tensorboard==1.14.0
tensorflow==2.0.0b1
tensorflow-datasets==1.2.0
tensorflow-estimator==1.14.0
tensorflow-gan==1.0.0.dev0
tensorflow-metadata==0.14.0
tensorflow-probability==0.7.0


python -V
Python 3.7.3```

### For bugs: reproduction and error logs

Steps to reproduce:

from tensor2tensor import problems Traceback (most recent call last): File "", line 1, in File "C:\Users\Anaconda3\lib\site-packages\tensor2tensor\problems.py", line 22, in from tensor2tensor.utils import registry File "C:\Users\Anaconda3\lib\site-packages\tensor2tensor\ut

I want to execute the given example program given.

Error logs:

...

newmluser avatar Sep 16 '19 02:09 newmluser

Can anyone help me , how I can see the problems() available,


from tensor2tensor import problems
problems.available()

Its giving Error from tensor2tensor import problems Traceback (most recent call last): File "", line 1, in File "C:\Users\Anaconda3\lib\site-packages\tensor2tensor\problems.py", line 22, in from tensor2tensor.utils import registry File "C:\Users\Anaconda3\lib\site-packages\tensor2tensor\utils\registry.py", line 551, in attacks = tf.contrib.framework.deprecated(None, "Use registry.attack")(attack) AttributeError: module 'tensorflow' has no attribute 'contrib'

newmluser avatar Sep 18 '19 21:09 newmluser

i pray for your success in finding the solution

DzakirinMD avatar Nov 03 '19 22:11 DzakirinMD

i've noticed that your tf version is tensorflow==2.0.0b1. please note that as of TF 2.0 the contrib is not available anymore.

current workaround for me is to install older version of TF. for me TF 1.15.0 works the best for now.

reference: https://github.com/tensorflow/community/pull/18 , https://github.com/tensorflow/models/issues/7036

DzakirinMD avatar Nov 11 '19 10:11 DzakirinMD

TF 2.0 is the latest official version now, yet tensor2tensor seems to not support it!

Hamza5 avatar Nov 11 '19 10:11 Hamza5