tx2 jetpack4.2 安装tensorflow-gpu

TX2 (JetPack4.2)安装TensorFlow-gpu有个问题:4.2刷机安装的cudnn是7.3版本的,而tensorflow1.14及其以上需要的是7.4以上的cudnn

安装版本:JetPack4.2
更换cudnn版本:https://blog.csdn.net/qq_42608626/article/details/106927046

1.安装java

sudo apt-get install openjdk-8-jdk
java -version
配置环境
which javac //查找javac可执行文件
file /usr/bin/javac // 查看链接目标
file /etc/alternatives/javac // 查看链接目标
file /usr/lib/jvm/java-8-openjdk-arm64/bin/javac
sudo gedit ~/.bashrc
// 将下面的代码粘贴到最后
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-arm64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source ~/.bashrc

2.安装bazel(未安装也成功了)

bazel官方提供的下载地址:https://github.com/bazelbuild/bazel/releases?after=0.10.0

Step 1: Install required packages
First, install the prerequisites: pkg-config, zip, g++, zlib1g-dev, unzip, and python.

sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python
Step 2: Download Bazel
Next, download the Bazel binary installer named bazel--installer-linux-x86_64.sh from the Bazel releases page on GitHub.

Step 3: Run the installer
Run the Bazel installer as follows:

chmod +x bazel--installer-linux-x86_64.sh
./bazel--installer-linux-x86_64.sh --user
The --user flag installs Bazel to the $HOME/bin directory on your system and sets the .bazelrc path to $HOME/.bazelrc. Use the --help command to see additional installation options.

Step 4: Set up your environment
If you ran the Bazel installer with the --user flag as above, the Bazel executable is installed in your $HOME/bin directory. It’s a good idea to add this directory to your default paths, as follows:

export PATH=“ P A T H : PATH: PATH:HOME/bin”
You can also add this command to your ~/.bashrc file.

Note: Bazel includes an embedded JDK, which can be used even if a JDK is already installed. bazel--without-jdk-installer-linux-x86_64.sh is a version of the installer without an embedded JDK. Only use this installer if you already have JDK 8 installed. Later JDK versions are not supported.

其它依赖项
sudo apt-get install zip unzip autoconf automake libtool curl zlib1g-dev maven
sudo apt-get install python3-numpy swig python3-dev  python3-wheel python3-h5py

2.安装pip3

源码编译

首先,到官网下载最新的.tar.gz压缩包,解压并进入到文件夹中,使用下面的命令安装pip3

sudo python3 setup.py install

如果它报出缺少setuptools这样的问题,
而且你已经执行过’sudo apt-get install python3-pip’命令了,可以输入下面的命令安装setuptools:

pip3 install setuptools

果你没有执行过’sudo apt-get install python3-pip’的命令,那么可以执行下面的命令来安装setuptools:

 sudo apt-get inatall python3-setuptools

然后再重新运行安装脚本。

3.下载安装TensorFlow-gpu

3.1 到官网下载jetpack4.2对应版本的tensorflow

网址:https://developer.nvidia.com/embedded/downloads#?search=tensorflow

3.2 安装
pip3 install tensorflow_gpu-1.14.0+nv19.7-cp36-cp36m-linux_aarch64.whl --user

参考文章:https://blog.csdn.net/macunshi/article/details/86813885

你可能感兴趣的:(cuda,c++)