tensorflow / tensorflow/models

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

Open
#8,932 7 comments 1 reaction 3 assignees View on GitHub

@pkulzc is already working on this.

Since Sep 3, 2020.

models:research:odapi type:bug
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

Prerequisites

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

  • I am using the latest TensorFlow Model Garden release and TensorFlow 2.
  • I am reporting the issue to the correct repository. (Model Garden official or research directory)
  • 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/blob/master/research/object_detection/builders/model_builder_tf1_test.py

2. Describe the bug

Under the remarks on TensorFlow 1 Detection Model Zoo, it says, quote:

"Our frozen inference graphs are generated using the v1.12.0 release version of TensorFlow and we do not guarantee that these will work with other versions"

Based on that remark, I decided to install tensorflow-gpu=1.12 and then proceeded to install TF1 Object Detection API. However, when I test the installation by running:

python object_detection/builders/model_builder_tf1_test.py

I get the following error:

Traceback (most recent call last): File "object_detection/builders/model_builder_tf1_test.py", line 19, in <module> import tensorflow.compat.v1 as tf ModuleNotFoundError: No module named 'tensorflow.compat.v1'

3. Steps to reproduce

Follow the installation instructions here, with tf v1.12.0

4. Expected behavior

Shouldn't throw that error.

5. Additional context

Include any logs that would be helpful to diagnose the problem.

6. System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): NAME="CentOS Linux" VERSION="7 (Core)"
  • Mobile device name if the issue happens on a mobile device: N/A
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 1.12.0
  • Python version: 3.6.10
  • CUDA/cuDNN version: 9.1/7.0.5
  • GPU model and memory: Tesla P100

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.