This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tips:keras [2018/08/23 15:09] – [Export protobuf] scipio | tips:keras [2019/12/17 15:48] (current) – [tensorflow] scipio | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Keras ====== | ====== Keras ====== | ||
| + | |||
| + | ===== tensorflow ===== | ||
| + | |||
| + | * yay bazelisk | ||
| + | |||
| + | < | ||
| + | pip install -U pip six numpy wheel setuptools mock | ||
| + | pip install -U keras_applications --no-deps | ||
| + | pip install -U keras_preprocessing --no-deps | ||
| + | |||
| + | # tf 2 | ||
| + | git clone https:// | ||
| + | cd tensorflow | ||
| + | |||
| + | # tf 1.15 | ||
| + | wget https:// | ||
| + | tar zxvf v1.15.0.tar.gz | ||
| + | </ | ||
| + | |||
| + | only for tf 2 | ||
| + | < | ||
| + | wget https:// | ||
| + | patch -Np1 -i Add-grpc-fix-for-gettid.patch | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | export TF_IGNORE_MAX_BAZEL_VERSION=1 | ||
| + | export TF_NEED_CUDA=1 | ||
| + | ./configure | ||
| + | </ | ||
| + | |||
| + | for atf 1.15 | ||
| + | < | ||
| + | echo 0.26.1 > .bazelversion | ||
| + | </ | ||
| + | |||
| + | this produce .tf_configure.bazelrc | ||
| + | < | ||
| + | build --action_env PYTHON_BIN_PATH="/ | ||
| + | build --action_env PYTHON_LIB_PATH="/ | ||
| + | build --python_path="/ | ||
| + | build:xla --define with_xla_support=true | ||
| + | build --config=xla | ||
| + | build --action_env CUDA_TOOLKIT_PATH="/ | ||
| + | build --action_env TF_CUDA_COMPUTE_CAPABILITIES=" | ||
| + | build --action_env LD_LIBRARY_PATH="/ | ||
| + | build --action_env GCC_HOST_COMPILER_PATH="/ | ||
| + | build --config=cuda | ||
| + | build:opt --copt=-march=native | ||
| + | build:opt --copt=-Wno-sign-compare | ||
| + | build:opt --host_copt=-march=native | ||
| + | build:opt --define with_default_optimizations=true | ||
| + | test --flaky_test_attempts=3 | ||
| + | test --test_size_filters=small, | ||
| + | test --test_tag_filters=-benchmark-test, | ||
| + | test --build_tag_filters=-benchmark-test, | ||
| + | build --action_env TF_CONFIGURE_IOS=" | ||
| + | </ | ||
| + | |||
| + | compile | ||
| + | < | ||
| + | bazel build // | ||
| + | |||
| + | # ??? | ||
| + | bazelisk \ | ||
| + | build --config=opt \ | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | ./ | ||
| + | pip install / | ||
| + | </ | ||
| + | |||
| + | ===== from keras to opencv | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | |||
| ===== Export protobuf ===== | ===== Export protobuf ===== | ||