Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

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

Open
newmluser opened this issue Sep 16, 2019 · 4 comments
Open

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

newmluser opened this issue Sep 16, 2019 · 4 comments

Comments

@newmluser
Copy link

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
Copy link
Author

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'

@DzakirinMD
Copy link

i pray for your success in finding the solution

@DzakirinMD
Copy link

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: tensorflow/community#18 , tensorflow/models#7036

@Hamza5
Copy link
Contributor

Hamza5 commented Nov 11, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants