Sign inSign up

anujonthemove/tensorflow_od_api_v1

By anujonthemove

•Updated about 5 years ago

Docker for training TensorFlow Object Detection API Verison 1 models.

Image
0

107

anujonthemove/tensorflow_od_api_v1 repository overview

⁠Instructions for building this docker

⁠1. Clone the TensorFlow Models repository and proceed to one of the installation options.
git clone https://github.com/tensorflow/models.git
⁠2. Docker Installation
# From the root of the git repository
docker build -f research/object_detection/dockerfiles/tf1/Dockerfile -t od .
docker run -it od
⁠3. Python Package Installation
cd models/research
# Compile protos.
protoc object_detection/protos/*.proto --python_out=.

# Install TensorFlow Object Detection API.
cp object_detection/packages/tf1/setup.py .
python -m pip install --use-feature=2020-resolver .

# Test the installation.
python object_detection/builders/model_builder_tf1_test.py
⁠Note: All the above instructions are taken directly from the official Tensorflow models⁠ page
⁠4. Install OpenCV dependencies

When you try to run the object detection api pipeline, you will run into the following error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Some of the required libraries are missing in the default docker therefore we need to run the following:

apt update && apt install -y libsm6 libxext6 ffmpeg libfontconfig1 libxrender1 libgl1-mesa-glx

The docker that you have just build is a user docker hence you will not be allowed to install packages directly. You need to 'exec' the docker as root in another terminal (this assumes that a docker container is still running. If you are not sure how to run this docker, the instructions to do so are below)

docker exec -it --user="root" <docker name> bash
⁠5. Commit your changes to docker image
docker commit <docker name> <docker image>:<tag>
⁠Note: You need not do all the above, just pull this image I have shared it here. :)

⁠Instructions to run this docker

⁠Note: I am assuming that you have the following
  1. Running Ubuntu 18.04 and above
  2. Compatible CUDA version and NVIDIA drivers for TensorFlow v1.15
  3. Latest NVIDIA Docker⁠ is installed
⁠1. pull this image
docker pull anujonthemove/tensorflow_od_api_v1:v1.15
⁠2. Run this command from /home of your Ubuntu
docker run -it --rm --name tf_1_od_api --gpus all -it -v $(pwd):/tf  -v /path/to/another/shared/location:/home/tensorflow/models/research/mount/   od:latest
  • Running from /home ensures that you can access all your folders inside this docker

And that's it!

Please reach out to me on my email: [email protected]⁠ for any other queries.

Tag summary

Content type

Image

Digest

Size

2.7 GB

Last updated

about 5 years ago

docker pull anujonthemove/tensorflow_od_api_v1:v1.15