Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2' #8088

Closed
wiamadaya opened this issue Jan 27, 2020 · 14 comments
Closed

Comments

@wiamadaya
Copy link

i receive the following error when following the installation steps https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

(tensorflow_p36) ubuntu@ip-xxx-xx-xx-xx:~/tensorflow/models/research$ python object_detection/builders/model_builder_test.py

Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 23, in <module> from object_detection.builders import model_builder File "/home/ubuntu/tensorflow/models/research/object_detection/builders/model_builder.py", line 47, in <module> from object_detection.models.ssd_mobilenet_edgetpu_feature_extractor import SSDMobileNetEdgeTPUFeatureExtractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_edgetpu_feature_extractor.py", line 19, in <module> from object_detection.models import ssd_mobilenet_v3_feature_extractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_v3_feature_extractor.py", line 25, in <module> from nets.mobilenet import mobilenet File "/home/ubuntu/tensorflow/models/research/slim/nets/mobilenet/mobilenet.py", line 399, in <module> def global_pool(input_tensor, pool_op=tf.compat.v2.nn.avg_pool2d): AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2'

@wiamadaya
Copy link
Author

solved the problem by cloning the models v1.13.0

@Aparnamaurya
Copy link

solved the problem by cloning the models v1.13.0

Hi Wiamadaya, I am running into the same issue. Could you please elaborate how did you solve this problem?

the tensorflow version which I'm using is 1.13.1.

@wiamadaya
Copy link
Author

solved the problem by cloning the models v1.13.0

Hi Wiamadaya, I am running into the same issue. Could you please elaborate how did you solve this problem?

the tensorflow version which I'm using is 1.13.1.

hi @Aparnamaurya just download the 1.13.0 release instead https://github.com/tensorflow/models/archive/v1.13.0.zip since we are using TF 1.13

@EmreSeverr
Copy link

Hello @wiamadaya
ERROR: Could not find a version that satisfies the requirement tensorflow==1.13 (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 1.15.2, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0)
ERROR: No matching distribution found for tensorflow==1.13
I cant install tensorflow-1.13.0. Can you help me?

@markdude247
Copy link

markdude247 commented Feb 9, 2020

Please read PIP output it shares available versions.

tensorflow-1.13.1, 1.13.2

@fkhjoy
Copy link

fkhjoy commented Feb 19, 2020

solved the problem by cloning the models v1.13.0

Hi Wiamadaya, I am running into the same issue. Could you please elaborate how did you solve this problem?
the tensorflow version which I'm using is 1.13.1.

hi @Aparnamaurya just download the 1.13.0 release instead https://github.com/tensorflow/models/archive/v1.13.0.zip since we are using TF 1.13

Thanks it worked by downloading the v1.13.0 version

@DeliciousHY
Copy link

Hello @wiamadaya
ERROR: Could not find a version that satisfies the requirement tensorflow==1.13 (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 1.15.2, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0)
ERROR: No matching distribution found for tensorflow==1.13
I cant install tensorflow-1.13.0. Can you help me?

what he means is that the model's version is 1.13.0

@xenc0d3r
Copy link

@DeliciousHY he is talking about the models directory not the tensorflow version. So you get tensorflow==1.13.1 installed and go to tensorflow model archives and download the 1.13.1 models folder.

@john-khgoh
Copy link

Seems like a workaround rather than solution tho 🤔

@pedrogalher
Copy link

pedrogalher commented Apr 16, 2020

Where did you place the models folder?

@fkhjoy
Copy link

fkhjoy commented Apr 16, 2020

Where did you place the models folder?
in your tensorflow directory.
something like ..Lib/site-packages/tensorflow/

@vlzzhou
Copy link

vlzzhou commented Jun 8, 2020

遵循安装步骤https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md时我收到以下错误[](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md)

(tensorflow_p36) ubuntu@ip-xxx-xx-xx-xx:~/tensorflow/models/research$ python object_detection/builders/model_builder_test.py

Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 23, in <module> from object_detection.builders import model_builder File "/home/ubuntu/tensorflow/models/research/object_detection/builders/model_builder.py", line 47, in <module> from object_detection.models.ssd_mobilenet_edgetpu_feature_extractor import SSDMobileNetEdgeTPUFeatureExtractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_edgetpu_feature_extractor.py", line 19, in <module> from object_detection.models import ssd_mobilenet_v3_feature_extractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_v3_feature_extractor.py", line 25, in <module> from nets.mobilenet import mobilenet File "/home/ubuntu/tensorflow/models/research/slim/nets/mobilenet/mobilenet.py", line 399, in <module> def global_pool(input_tensor, pool_op=tf.compat.v2.nn.avg_pool2d): AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2'

Excuse me, how to deal with this problem?I'm consistently confused

@DeliciousHY
Copy link

遵循安装步骤[https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md时我收到以下错误](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md%E6%97%B6%E6%88%91%E6%94%B6%E5%88%B0%E4%BB%A5%E4%B8%8B%E9%94%99%E8%AF%AF%5B%5D(https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md))
(tensorflow_p36) ubuntu@ip-xxx-xx-xx-xx:~/tensorflow/models/research$ python object_detection/builders/model_builder_test.py
Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 23, in <module> from object_detection.builders import model_builder File "/home/ubuntu/tensorflow/models/research/object_detection/builders/model_builder.py", line 47, in <module> from object_detection.models.ssd_mobilenet_edgetpu_feature_extractor import SSDMobileNetEdgeTPUFeatureExtractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_edgetpu_feature_extractor.py", line 19, in <module> from object_detection.models import ssd_mobilenet_v3_feature_extractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_v3_feature_extractor.py", line 25, in <module> from nets.mobilenet import mobilenet File "/home/ubuntu/tensorflow/models/research/slim/nets/mobilenet/mobilenet.py", line 399, in <module> def global_pool(input_tensor, pool_op=tf.compat.v2.nn.avg_pool2d): AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2'

Excuse me, how to deal with this problem?I'm consistently confused

may is your tensorflow's version 's problem

@vlzzhou
Copy link

vlzzhou commented Jun 8, 2020

遵循安装步骤https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md时我收到以下错误
(tensorflow_p36) ubuntu@ip-xxx-xx-xx-xx:~/tensorflow/models/research$ python object_detection/builders/model_builder_test.py
Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 23, in <module> from object_detection.builders import model_builder File "/home/ubuntu/tensorflow/models/research/object_detection/builders/model_builder.py", line 47, in <module> from object_detection.models.ssd_mobilenet_edgetpu_feature_extractor import SSDMobileNetEdgeTPUFeatureExtractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_edgetpu_feature_extractor.py", line 19, in <module> from object_detection.models import ssd_mobilenet_v3_feature_extractor File "/home/ubuntu/tensorflow/models/research/object_detection/models/ssd_mobilenet_v3_feature_extractor.py", line 25, in <module> from nets.mobilenet import mobilenet File "/home/ubuntu/tensorflow/models/research/slim/nets/mobilenet/mobilenet.py", line 399, in <module> def global_pool(input_tensor, pool_op=tf.compat.v2.nn.avg_pool2d): AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2'

Excuse me, how to deal with this problem?I'm consistently confused

may is your tensorflow's version 's problem

I have tried many versions of tensorflow and this problem occurs:AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2'

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

No branches or pull requests

10 participants