NX入门教程软件篇-安装TensorFlow带有cuda
NX入门教程软件篇-安装TensorFlow带有cuda
说明:
- 介绍安装TensorFlow
- 环境:jetpack4.4 + TensorFlow (2.3) + TensorFlow 1.15 + cuda
步骤:
- 安装依赖
$ sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
install and upgrade pip3
$ sudo apt-get install python3-pip
$ sudo pip3 install -U pip testresources setuptools
install the following python packages
$ sudo pip3 install -U numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11
to install TensorFlow 1.15 for JetPack 4.4:
$ sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 ‘tensorflow<2’
or install the latest version of TensorFlow (2.3) for JetPack 4.4:
$ sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow
测试:
- 新建文件 vim hello_world.py
- 内容如下:
import tensorflow as tf
msg = tf.constant('TensorFlow 2.0 Hello World')
tf.print(msg)
print('GPU', tf.test.is_gpu_available())
- 效果:
python3 hello_world.py
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号