tensorflow / tensorflow/models

Dockerfile installs two tensorflow versions when building

Open
#9,911 8 comments 5 reactions 3 assignees View on GitHub

@pkulzc is already working on this.

Since Apr 16, 2021.

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

Description

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/238922e98dd0e8254b5c0921b241a1f5a151782f/research/object_detection/dockerfiles/tf2/Dockerfile

2. Describe the bug

Some of the python requirements that gets installed from the "/models/research/object_detection/packages/tf2/setup.py" leads to the installation of the latest tensorflow version (2.4.1). Since the dockerfile is building with the tensorflow/tensorflow:2.2.0-gpu image as starting point, I now have tensorflow:2.2.0-gpu AND tensorflow:2.4.1 installed.

When I try to train on a network I get the following output:

python object_detection/model_main_tf2.py --pipeline_config_path=${PIPELINE_CONFIG_PATH} --model_dir=${MODEL_DIR} --alsologtostderr

Traceback (most recent call last):
File "object_detection/model_main_tf2.py", line 31, in
import tensorflow.compat.v2 as tf
File "/home/tensorflow/.local/lib/python3.6/site-packages/tensorflow/init.py", line 436, in
_ll.load_library(_main_dir)
File "/home/tensorflow/.local/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 153, in load_library
py_tf.TF_LoadLibrary(lib)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow/core/kernels/libtfkernel_sobol_op.so: undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb

3. Steps to reproduce

Clone the "models" repository and install using docker. Follow installation instructions here:
https://github.com/tensorflow/models/blob/238922e98dd0e8254b5c0921b241a1f5a151782f/research/object_detection/g3doc/tf2.md

Start training on a network:
https://github.com/tensorflow/models/blob/238922e98dd0e8254b5c0921b241a1f5a151782f/research/object_detection/g3doc/tf2_training_and_evaluation.md


 PIPELINE_CONFIG_PATH={path to pipeline config file}
 MODEL_DIR={path to model directory}
 python object_detection/model_main_tf2.py \
     --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
     --model_dir=${MODEL_DIR} \
     --alsologtostderr

4. Expected behavior

I want to use the tensorflow:2.2.0-gpu or tensorflow:X.X.X-gpu. I do not want another tensorflow version to get installed during building as this screws up the environment.

5. Additional context

After the python requirements from the https://github.com/tensorflow/models/blob/238922e98dd0e8254b5c0921b241a1f5a151782f/research/object_detection/packages/tf2/setup.py file is installed while building the dockerfile, I get the following output indicating that all tensorflow related packages has been updated to version 2.4 as well.

Successfully built object-detection avro-python3 crcmod dill future docopt pycocotools kaggle py-cpuinfo python-slugify seqeval promise
Installing collected packages: pyparsing, pytz, packaging, numpy, googleapis-common-protos, google-auth, wheel, threadpoolctl, text-unidecode, python-dateutil, pillow, kiwisolver, joblib, httplib2, grpcio, google-crc32c, google-api-core, cycler, uritemplate, typing-extensions, typeguard, tqdm, tensorflow-metadata, tensorflow-estimator, scikit-learn, python-slugify, proto-plus, promise, pbr, matplotlib, importlib-resources, google-resumable-media, google-cloud-core, google-auth-httplib2, future, flatbuffers, docopt, dm-tree, dill, dataclasses, Cython, attrs, tf-slim, tensorflow-model-optimization, tensorflow-hub, tensorflow-datasets, tensorflow-addons, tensorflow, seqeval, sentencepiece, pyyaml, pymongo, pydot, pycocotools, pyarrow, py-cpuinfo, psutil, pandas, opencv-python-headless, opencv-python, oauth2client, mock, kaggle, hdfs, google-cloud-bigquery, google-api-python-client, gin-config, fastavro, crcmod, avro-python3, tf-models-official, lvis, contextlib2, apache-beam, object-detection
Successfully installed Cython-0.29.23 apache-beam-2.28.0 attrs-20.3.0 avro-python3-1.9.2.1 contextlib2-0.6.0.post1 crcmod-1.7 cycler-0.10.0 dataclasses-0.8 dill-0.3.1.1 dm-tree-0.1.6 docopt-0.6.2 fastavro-1.3.5 flatbuffers-1.12 future-0.18.2 gin-config-0.4.0 google-api-core-1.26.3 google-api-python-client-2.2.0 google-auth-1.28.1 google-auth-httplib2-0.1.0 google-cloud-bigquery-2.13.1 google-cloud-core-1.6.0 google-crc32c-1.1.2 google-resumable-media-1.2.0 googleapis-common-protos-1.53.0 grpcio-1.32.0 hdfs-2.6.0 httplib2-0.17.4 importlib-resources-5.1.2 joblib-1.0.1 kaggle-1.5.12 kiwisolver-1.3.1 lvis-0.5.3 matplotlib-3.3.4 mock-2.0.0 numpy-1.19.5 oauth2client-4.1.3 object-detection-0.1 opencv-python-4.5.1.48 opencv-python-headless-4.5.1.48 packaging-20.9 pandas-1.1.5 pbr-5.5.1 pillow-8.2.0 promise-2.3 proto-plus-1.18.1 psutil-5.8.0 py-cpuinfo-8.0.0 pyarrow-2.0.0 pycocotools-2.0.2 pydot-1.4.2 pymongo-3.11.3 pyparsing-2.4.7 python-dateutil-2.8.1 python-slugify-4.0.1 pytz-2021.1 pyyaml-5.4.1 scikit-learn-0.24.1 sentencepiece-0.1.95 seqeval-1.2.2 tensorflow-2.4.1 tensorflow-addons-0.12.1 tensorflow-datasets-4.2.0 tensorflow-estimator-2.4.0 tensorflow-hub-0.12.0 tensorflow-metadata-0.29.0 tensorflow-model-optimization-0.5.0 text-unidecode-1.3 tf-models-official-2.4.0 tf-slim-1.1.0 threadpoolctl-2.1.0 tqdm-4.60.0 typeguard-2.12.0 typing-extensions-3.7.4.3 uritemplate-3.0.1 wheel-0.36.2

6. System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • TensorFlow version: 2.2.0 and 2.4.1
  • Python version: 3.6.9
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: 11.2
  • GPU model and memory: RTX2080i

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.