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

Object detection API installation does not recognize tensorflow-gpu==2.5.0 already installed in the Conda virtual environment #10266

Open
3 tasks done
rsun-bdti opened this issue Sep 18, 2021 · 3 comments
Assignees
Labels

Comments

@rsun-bdti
Copy link

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/g3doc/tf2.md#python-package-installation

https://github.com/tensorflow/models/blob/master/research/object_detection/packages/tf2/setup.py

2. Describe the bug

Running setup.py to install object detection API installs tensorflow==2.6.0 official in my Conda virtual environment. tensorflow-gpu==2.5.0 was already installed in the environment, and it should be used instead.

The behavior is similar to the complaint in issue #9267, except that was in a docker container. In my case, it's the Conda virtual environment.

Is this a bug? Or is it something wrong with my Conda configuration?

3. Steps to reproduce

Follow the steps below to reproduce the bug.

nano conda-env-tf25-cuda11-p36.yaml

name: env-test
channels:
  - conda-forge
  - defaults
dependencies:
  - pip=21.2.4=pyhd8ed1ab_0
  - python=3.6.13=hb7a2778_1_cpython
  - flatbuffers==1.12
  - matplotlib==3.3.4
  - numpy==1.19.5
  - pandas==1.1.5
  - pillow==8.3.2
  - tensorboard==2.5.0
  - pip:
    - opencv-python==4.5.3.56
    - opencv-python-headless==4.5.3.56
    - protobuf==3.17.3
    - scipy==1.5.4
    - tensorflow-gpu==2.5.0

conda -V

conda 4.10.3

conda env create --file conda-env-tf25-cuda11-p36.yaml --force

conda activate env-test

python -c 'import tensorflow as tf; print(tf.__version__)'

2021-09-17 17:33:17.425787: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
2.5.0

git clone https://github.com/tensorflow/models.git

cd models/research

protoc object_detection/protos/*.proto --python_out=.

cp object_detection/packages/tf2/setup.py .

python -m pip install --use-feature=2020-resolver .

(Terminal displayed information about many packages being installed)

python -c 'import tensorflow as tf; print(tf.__version__)'

2.6.0

Not only was the Tensorflow version changed from 2.5.0 to 2.6.0, but also no CUDA information was displayed.

4. Expected behavior

tensorflow-gpu==2.5.0 in the Conda virtual environment should not be replaced by Tensorflow 2.6.0 CPU.

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): Linux Ubuntu 18.04
  • Mobile device name if the issue happens on a mobile device:
  • TensorFlow installed from (source or binary): Binary
  • TensorFlow version (use command below): tensorflow-gpu==2.5.0
  • Python version: 3.6.13
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: CUDA 11.0/cuDNN 8.2.4
  • GPU model and memory: GeForce RTS 2080 TI
@rsun-bdti rsun-bdti added models:research models that come under research directory type:bug Bug in the code labels Sep 18, 2021
@kumariko kumariko self-assigned this Sep 20, 2021
@kumariko kumariko added models:research:odapi ODAPI and removed models:research models that come under research directory labels Sep 20, 2021
@kumariko kumariko assigned tombstone, jch1 and pkulzc and unassigned kumariko Sep 20, 2021
@MrinalJain17
Copy link

Faced a similar issue.

Internally, the object detection package installs tf-models-official, which has a dependency on tensorflow-text. Pip ends up fetching the latest version of text (2.6.0), which in turn requires TF 2.6. That is probably why your TF installation is overridden.

A potential workaround could be to manually install tensorflow-text (2.4) before installing the object detection package.

install_requires.append('tensorflow-text>=2.4.0')

@LUYIJUN1206074121
Copy link

I have the same question, may I know you how to solove it?

@thmsgntz
Copy link

Hello, have a look a this issue #9911, might help you.

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

No branches or pull requests

8 participants