Models: ModuleNotFoundError: No module named 'tensorflow.compat.v1'

Created on 16 Jul 2020  路  4Comments  路  Source: tensorflow/models

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [ ] I am using the latest TensorFlow Model Garden release and TensorFlow 2.
  • [x] I am reporting the issue to the correct repository. (Model Garden official or research directory)
  • [x] I checked to make sure that this issue has not already been filed.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/tree/master/research/feelvos

2. Describe the bug

I got the following error when running bash train.sh.
The README doesn't tell us which TF to use.

The backward compatibility of TF is REALLY AWFUL.

Traceback (most recent call last):
  File "/mnt/lustre/xiehaozhe/Development/feelvos/train.py", line 24, in <module>
    from feelvos import model
  File "/mnt/lustre/xiehaozhe/Development/feelvos/model.py", line 58, in <module>
    from deeplab import model
  File "/mnt/lustre/xiehaozhe/Development/feelvos/deeplab/model.py", line 58, in <module>
    from deeplab.core import feature_extractor
  File "/mnt/lustre/xiehaozhe/Development/feelvos/deeplab/core/feature_extractor.py", line 21, in <module>
    import tensorflow.compat.v1 as tf
ModuleNotFoundError: No module named 'tensorflow.compat.v1'

3. Steps to reproduce

bash train.sh

4. Expected behavior

The program runs normally without raising ModuleNotFoundError: No module named 'tensorflow.compat.v1'.

5. Additional context

None

6. System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Cent OS 7.3
  • Mobile device name if the issue happens on a mobile device: N/a
  • TensorFlow installed from (source or binary): Binary
  • TensorFlow version (use command below): 1.12.3
  • Python version: 3.6.5
  • Bazel version (if compiling from source): N/a
  • GCC/Compiler version (if compiling from source): 5.4.0
  • CUDA/cuDNN version: 9.0
  • GPU model and memory: NVIDIA TITAN Xp / 12GB
research bug

Most helpful comment

Again, the backward compatibility of TF is REALLY AWFUL.

All 4 comments

If you're using Tensorflow 1.x I recommend you use the r1.13.0 branch.

@TannerGilbert
What if I only have CUDA 9? TensorFlow 1.13 requires CUDA 10.
DON'T TELL ME TO UPGRADE TO CUDA 10.

I solved this problem by

 git reset fe748d4a4a1576b57c279014ac0ceb47344399c4 --hard

Again, the backward compatibility of TF is REALLY AWFUL.

Was this page helpful?
0 / 5 - 0 ratings