跳到主要内容

TensorFlow环境搭建

TensorFlow环境搭建1、系统信息2、安装TensorFlow2.1、离线安装2.2、在线安装2.3、安装Numpy3、验证安装参考资料

TensorFlow 是一个由 Google 开发并开源的端到端机器学习和深度学习框架,用于构建和训练各种类型的机器学习模型。

1、系统信息

image-20250121150858152

查询CUDA版本

nvcc --version

image-20241226155536623

2、安装TensorFlow

TensorFlow的安装选择离线和在线的其中一种方式即可!

2.1、离线安装

手动进入下载网址下载指定的TensorFlow版本。

下载网址:https://developer.download.nvidia.com/compute/redist/jp/v61/tensorflow/

xxxxxxxxxx cd Downloads/ xxxxxxxxxx sudo pip3 install tensorflow-2.16.1+nv24.08-cp310-cp310-linux_aarch64.whl

2.2、在线安装

xxxxxxxxxx sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v61 tensorflow==2.16.1+nv24.08

2.3、安装Numpy

安装指定版本的Numpy:后期的YOLO11也需要该版本的Numpy

xxxxxxxxxx sudo pip install numpy==1.23.5

3、验证安装

xxxxxxxxxx python3 -c "import tensorflow as tf; print(f'TensorFlow: {tf.__version__}')"

image-20241230110433117

参考资料

https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html

https://pypi.jetson-ai-lab.dev/