问题:Doing a pip3 install tensorflow-addons from an Nvidia TX2 produce No matching distribution found for tensorflow-addons. My current TensorFlow is 2.8 from Jetpack 5.0.1
根据 Jetson AGX/TX2/Nano - Build release from pip3 install · Issue #1982 · tensorflow/addons · GitHub 的说法,需要自行编译tensorflow-addons ,
1. bazel 也需要编译安装才能安装上 参考连接 在jetson nano上安装bazel_帅的发光发亮的博客-CSDN博客
2.按官网方式编译 GitHub - tensorflow/addons: Useful extra functionality for TensorFlow 2.x maintained by SIG-addons
- git clone https://github.com/tensorflow/addons.git
- cd addons
-
- export TF_NEED_CUDA="1"
-
- # Set these if the below defaults are different on your system
- export TF_CUDA_VERSION="11"
- export TF_CUDNN_VERSION="8"
- export CUDA_TOOLKIT_PATH="/usr/local/cuda"
- export CUDNN_INSTALL_PATH="/usr/lib/aarch64-linux-gnu"
-
- # This script links project with TensorFlow dependency
- python3 ./configure.py
-
- bazel build build_pip_pkg
- bazel-bin/build_pip_pkg artifacts
-
- pip install artifacts/tensorflow_addons-*.whl
报错:FileNotFoundError: [Errno 2] No such file or directory: '/dt9/usr/bin/gcc'
Unable to build from source with GPU support · Issue #2712 · tensorflow/addons · GitHub
按这里所说:
sudo mkdir -p /dt9/usr sudo ln -s /usr/bin /dt9/usr/bin
继续编译,然后又报错:
/home/yxhy01/env-tool/tensorflow/addons/tensorflow_addons/custom_ops/layers/BUILD:7:18: Compiling tensorflow_addons/custom_ops/layers/cc/ops/correlation_cost_op.cc failed: undeclared inclusion(s) in rule '//tensorflow_addons/custom_ops/layers:_correlation_cost_ops.so':
this rule is missing dependency declarations for the following files included by 'tensorflow_addons/custom_ops/layers/cc/ops/correlation_cost_op.cc':
'/usr/lib/gcc/aarch64-linux-gnu/9/include/stddef.h'
'/usr/lib/gcc/aarch64-linux-gnu/9/include/stdarg.h'
'/usr/lib/gcc/aarch64-linux-gnu/9/include/stdint.h'
'/usr/lib/gcc/aarch64-linux-gnu/9/include/limits.h'
'/usr/lib/gcc/aarch64-linux-gnu/9/include/syslimits.h'
'/usr/lib/gcc/aarch64-linux-gnu/9/include/arm_neon.h'
'/usr/lib/gcc/aarch64-linux-gnu/9/include/arm_fp16.h'
Target //:build_pip_pkg failed to build
Use --verbose_failures to see the command lines of failed build steps.
解决办法:this rule is missing dependency declarations for the following fles.._阳阳鸭的博客-CSDN博客
清理bazel的缓存
rm -rf ~/.cache/bazel/
然后重新编译,过了!!
最后执行两步就完了:
- bazel-bin/build_pip_pkg artifacts
-
- pip install artifacts/tensorflow_addons-*.whl