这是全部的下载链接,直接找对应下载:
https://elinux.org/Jetson_Zoo#PyTorch_.28Caffe2.29
首先给出下载pytorch的代码,如果运行不起就直接https://nvidia.box.com/shared/static/j2dn48btaxosqp0zremqqm8pjelriyvs.whl
wget https://nvidia.box.com/shared/static/j2dn48btaxosqp0zremqqm8pjelriyvs.whl -O torch-1.6.0-cp36-cp36m-linux_aarch64.whl
sudo pip3 install torch-1.6.0-cp36-cp36m-linux_aarch64.whl
安装完了之后就可以通过下面的这个验证
import torch
print(torch.__version__)
print('CUDA available: ' + str(torch.cuda.is_available()))
a = torch.cuda.FloatTensor(2).zero_()
print('Tensor a = ' + str(a))
b = torch.randn(2).cuda()
print('Tensor b = ' + str(b))
c = a + b
print('Tensor c = ' + str(c))
# 安装一些必要的依赖包
sudo apt-get install libjpeg-dev zlib1g-dev
# 下载torchvision
git clone --branch v0.7.0 https://gitee.com/zero-one-game/vision torchvision
# 安装torchvision
cd torchvision
sudo python3 setup.py install
# OSError: libmpi_cxx.so.20: cannot open shared object file: No such file or directory ->>>>sudo apt-get install libopenmpi2
cd ../
pip3 install 'pillow<7'
用以下代码测试是否成功
import torchvision
print(torchvision.__version__)
在Jetson Xavier NX上安装torchvision编译报错:fatal error: libavcodec/avcodec.h: No such file or directory
look at the authou csdn
一条命令直接搞定
sudo apt-get install python3-opencv
通过终端验证直接通过
Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>>
若要删除用sudo apt-get remove python3-opencv
Created wheel for onnx: filename=onnx-1.4.1-cp36-cp36m-linux_aarch64.whl size=3646291 sha256=3632a794d71e5c744920b2abf7626a4fd3ca39b7ea47a85e7cb9f3a7c325dbf7
Stored in directory: /home/lqs/.cache/pip/wheels/45/d1/9f/9508c4176d79c0373629eff6cf2645e2dcbfb291bbe9dc2f8a
Successfully built onnx
Installing collected packages: onnx
Successfully installed onnx-1.4.1
if your platform is jetson xavier nx,I think you should see the offcial word,the website is :https://forums.developer.nvidia.com/t/official-tensorflow-for-jetson-agx-xavier/65523
jetson nano look at here
1.sudo apt install python3-pip python3-dev
2.python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
#使用下述指令可以更改python镜像源为清华pypi镜像源
3.pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
4.#安装机器学习常用包
sudo apt install python3-scipy -y
sudo apt install python3-pandas -y
sudo apt install python3-sklearn -y
sudo apt install python3-seaborn -y
sudo pip install cython
上述指令会自动安装numpy和matplotlib等依赖包
5.
sudo apt-get update
sudo apt install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
6.#安装Python依赖包
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 astor
7.#download tensorflow https://developer.download.nvidia.com/compute/redist/jp/v45
pip3 install tensorflow-1.15.5+nv21.4-cp36-cp36m-linux_aarch64.whl --user
8.test
import tensorflow as tf
# 输出提示:
# 2020-10-11 15:25:36.253267: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.2
a = tf.constant(1.)
b = tf.constant(2.)
print(a+b)
# 输出结果:
# tf.Tensor(3.0, shape=(), dtype=float32)
print('GPU:', tf.test.is_gpu_available())
# 输出最后一句为:
# GPU: True
#this is NV
pip3 install tensorflow-1.15.5+nv21.3-cp36-cp36m-linux_aarch64.whl
# jetson xavier nx jetpack 4.5.2 cuda 10.2
pip install --no-cache-dir setuptools==20.7.0 -i https://pypi.doubanio.com/simple/
#下面是升级
pip install --ignore-installed setuptools
下载地址
https://files.pythonhosted.org/packages/5e/3f/5658c38579b41866ba21ee1b5020b8225cec86fe717e4b1c5c972de0a33c/pycuda-2019.1.2.tar.gz
tar zxvf pycuda-2019.1.2.tar.gz
cd pycuda-2019.1.2/
python3 configure.py --cuda-root=/usr/local/cuda-10.2
sudo python3 setup.py install