tips:keras

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:keras [2018/08/23 15:09] – [Export protobuf] scipiotips:keras [2019/12/17 15:48] (current) – [tensorflow] scipio
Line 1: Line 1:
 ====== Keras ====== ====== Keras ======
 +
 +===== tensorflow =====
 +
 +  * yay bazelisk
 +
 +<code>
 +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://github.com/tensorflow/tensorflow.git
 +cd tensorflow
 +
 +# tf 1.15
 +wget https://github.com/tensorflow/tensorflow/archive/v1.15.0.tar.gz
 +tar zxvf v1.15.0.tar.gz
 +</code>
 +
 +only for tf 2
 +<code>
 +wget https://git.archlinux.org/svntogit/community.git/plain/trunk/Add-grpc-fix-for-gettid.patch\?h\=packages/tensorflow -O Add-grpc-fix-for-gettid.patch
 +patch -Np1  -i Add-grpc-fix-for-gettid.patch
 +</code>
 +
 +<code>
 +export TF_IGNORE_MAX_BAZEL_VERSION=1
 +export TF_NEED_CUDA=1
 +./configure
 +</code>
 +
 +for atf 1.15
 +<code>
 +echo 0.26.1 > .bazelversion
 +</code>
 +
 +this produce .tf_configure.bazelrc
 +<code>
 +build --action_env PYTHON_BIN_PATH="/lab/gianoobserver/lib/bin/python"
 +build --action_env PYTHON_LIB_PATH="/lab/gianoobserver/lib/lib/python3.8/site-packages"
 +build --python_path="/lab/gianoobserver/lib/bin/python"
 +build:xla --define with_xla_support=true
 +build --config=xla
 +build --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda"
 +build --action_env TF_CUDA_COMPUTE_CAPABILITIES="6.1"
 +build --action_env LD_LIBRARY_PATH="/lab/dnn/lib/lib"
 +build --action_env GCC_HOST_COMPILER_PATH="/usr/bin/gcc-8"
 +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,medium
 +test --test_tag_filters=-benchmark-test,-no_oss,-gpu,-oss_serial
 +test --build_tag_filters=-benchmark-test,-no_oss,-gpu
 +build --action_env TF_CONFIGURE_IOS="0"
 +</code>
 +
 +compile
 +<code>
 +bazel build //tensorflow/tools/pip_package:build_pip_package
 +
 +# ???
 +bazelisk \
 +    build --config=opt \
 +      //tensorflow:libtensorflow.so \
 +      //tensorflow:libtensorflow_cc.so \
 +      //tensorflow:install_headers \
 +      //tensorflow/tools/pip_package:build_pip_package
 +./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
 +pip install /tmp/tensorflow_pkg/tensorflow*.whl
 +</code>
 +
 +===== from keras to opencv  =====
 +
 +  * https://github.com/adoval4/keras_to_OpenCV_tensorflow
 +
 +
  
 ===== Export protobuf ===== ===== Export protobuf =====
  • tips/keras.1535029776.txt.gz
  • Last modified: 2018/08/23 15:09
  • by scipio