diff --git a/tools/docker/README.md b/tools/docker/README.md index c9827a7d6cd45f364404a5d1629acb904b6af74c..8722b52e539303319b50a9de8ca3f11ff721597e 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -74,7 +74,8 @@ docker build --network='host' -t otbtf:oldstable-gpu --build-arg BASE_IMG=nvidia ### Build for another machine and save TF compiled files ```bash -# Use same ubuntu and CUDA version than your target machine, beware of CC optimization and CPU compatibilty (avoid "-march=native") +# Use same ubuntu and CUDA version than your target machine, beware of CC optimization and CPU compatibilty +# (set env variable CC_OPT_FLAGS and avoid "-march=native" if your Docker's CPU is optimized with AVX2/AVX512 but your target CPU isn't) docker build --network='host' -t otbtf:custom --build-arg BASE_IMG=nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 \ --build-arg TF=v2.5.0 --build-arg ZIP_TF_BIN=true . # Retrieve zip file @@ -86,14 +87,14 @@ unzip tf-v2.5.0.zip sudo mkdir -p /opt/tensorflow/lib sudo mv tf-v2.5.0/libtensorflow_cc* /opt/tensorflow/lib # You may need to create a virtualenv, here TF and dependencies are installed next to user's pip packages -pip3 install --no-cache-dir -U pip wheel mock six future deprecated "numpy==1.19.*" -pip3 install --no-cache-dir --no-deps keras_applications keras_preprocessing +pip3 install -U pip wheel mock six future deprecated "numpy==1.19.*" +pip3 install --no-deps keras_applications keras_preprocessing pip3 install tf-v2.5.0/tensorflow-2.5.0-cp38-cp38-linux_x86_64.whl TF_WHEEL_DIR="$HOME/.local/lib/python3.8/site-packages/tensorflow" # If you installed the wheel as regular user, with root pip it should be in /usr/local/lib/python3.*, or in your virtualenv lib/ directory mv tf-v2.5.0/tag_constants.h $TF_WHEEL_DIR/include/tensorflow/cc/saved_model/ -# Then recompile OTB with OTBTF using libraries in /opt/tensorflow/lib and instructions in [HOWTOBUILD.md](../../doc/HOWTOBUILD.md). +# Then recompile OTB with OTBTF using libraries in /opt/tensorflow/lib and instructions in HOWTOBUILD.md. cmake $OTB_GIT \ -DOTB_USE_TENSORFLOW=ON -DModule_OTBTensorflow=ON \ -DTENSORFLOW_CC_LIB=/opt/tensorflow/lib/libtensorflow_cc.so.2 \