From 6f389ae10f40311e2d4a088235f63c0de10c0223 Mon Sep 17 00:00:00 2001 From: Vincent Delbar <vincent.delbar@latelescop.fr> Date: Fri, 16 Jul 2021 12:43:10 +0200 Subject: [PATCH] ENH: update docker README.md --- tools/docker/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/docker/README.md b/tools/docker/README.md index c9827a7..8722b52 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 \ -- GitLab