jetson tx1 安装Pytorch

环境 jtop

pytorch 版本

1.安装pytorch

wget https://nvidia.box.com/shared/static/fjtbno0vpo676a25cgvuqc1wty0fkkg6.whl -O torch-1.10.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev libomp-dev
pip3 install Cython
pip3 install numpy torch-1.10.0-cp36-cp36m-linux_aarch64.whl

2.安装torchvision

jetson@jetson-desktop:~/torch$ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
libjpeg-dev 已经是最新版 (8c-2ubuntu8)。
libpython3-dev 已经是最新版 (3.6.7-1~18.04)。
zlib1g-dev 已经是最新版 (1:1.2.11.dfsg-0ubuntu2.2)。
libavcodec-dev 已经是最新版 (7:3.4.11-0ubuntu0.1)。
libavformat-dev 已经是最新版 (7:3.4.11-0ubuntu0.1)。
libswscale-dev 已经是最新版 (7:3.4.11-0ubuntu0.1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
jetson@jetson-desktop:~/torch$ git clone --branch v0.11.1  https://github.com/pytorch/vision torchvision
Cloning into 'torchvision'...
remote: Enumerating objects: 322005, done.
remote: Counting objects: 100% (5027/5027), done.
remote: Compressing objects: 100% (585/585), done.
remote: Total 322005 (delta 4596), reused 4828 (delta 4433), pack-reused 316978
Receiving objects: 100% (322005/322005), 653.96 MiB | 3.61 MiB/s, done.
Resolving deltas: 100% (295941/295941), done.
Note: checking out 'fa347eb9f38c1759b73677a11b17335191e3f602'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

jetson@jetson-desktop:~/torch$ cd cd torchvision
-bash: cd: too many arguments
jetson@jetson-desktop:~/torch$ git branch
fatal: not a git repository (or any of the parent directories): .git
jetson@jetson-desktop:~/torch$ cd  torchvision
jetson@jetson-desktop:~/torch/torchvision$ git branch
* (no branch)
jetson@jetson-desktop:~/torch/torchvision$ export BUILD_VERSION=0.11.1
jetson@jetson-desktop:~/torch/torchvision$ python3 setup.py install --user
Building wheel torchvision-0.11.1
PNG found: False
Running build on conda-build: False
Running build on conda: False
JPEG found: True
Building torchvision with JPEG image support


....
....
....


--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version      Pillow 9.5.0
platform     linux 3.6.9 (default, Mar 10 2023, 16:46:00)
             [GCC 8.4.0]
--------------------------------------------------------------------
--- JPEG support available
*** OPENJPEG (JPEG2000) support not available
--- ZLIB (PNG/ZIP) support available
*** LIBIMAGEQUANT support not available
*** LIBTIFF support not available
*** FREETYPE2 support not available
*** RAQM (Text shaping) support not available
*** LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX support not available
--- XCB (X protocol) support available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library and headers.
See https://pillow.readthedocs.io/en/latest/installation.html#building-from-source

To check the build, run the selftest.py script.

  File "build/bdist.linux-aarch64/egg/PIL/_deprecate.py", line 1
    from __future__ import annotations
                                     ^
SyntaxError: future feature annotations is not defined

Moving Pillow-9.5.0-py3.6-linux-aarch64.egg to /home/jetson/.local/lib/python3.6/site-packages
Adding Pillow 9.5.0 to easy-install.pth file

Installed /home/jetson/.local/lib/python3.6/site-packages/Pillow-9.5.0-py3.6-linux-aarch64.egg
Searching for torch==1.10.0
Best match: torch 1.10.0
Adding torch 1.10.0 to easy-install.pth file
Installing convert-caffe2-to-onnx script to /home/jetson/.local/bin
Installing convert-onnx-to-caffe2 script to /home/jetson/.local/bin
Installing torchrun script to /home/jetson/.local/bin

Using /home/jetson/.local/lib/python3.6/site-packages
Searching for numpy==1.19.5
Best match: numpy 1.19.5
Adding numpy 1.19.5 to easy-install.pth file
Installing f2py script to /home/jetson/.local/bin
Installing f2py3 script to /home/jetson/.local/bin
Installing f2py3.6 script to /home/jetson/.local/bin

Using /home/jetson/.local/lib/python3.6/site-packages
Searching for typing-extensions==4.1.1
Best match: typing-extensions 4.1.1
Adding typing-extensions 4.1.1 to easy-install.pth file

Using /home/jetson/.local/lib/python3.6/site-packages
Searching for dataclasses==0.8
Best match: dataclasses 0.8
Adding dataclasses 0.8 to easy-install.pth file

Using /home/jetson/.local/lib/python3.6/site-packages
Finished processing dependencies for torchvision==0.11.1
jetson@jetson-desktop:~/torch/torchvision$ pip install 'pillow<7'
-bash: pip: command not found

error :

(pytorch) jetson@ubuntu:~/torch/torchvision$ export BUILD_VERSION=0.11.1
(pytorch) jetson@ubuntu:~/torch/torchvision$ python3 setup.py install --user
Illegal instruction (core dumped)
(pytorch) jetson@ubuntu:~/torch/torchvision$ python3 setup.py install --user
Illegal instruction (core dumped)

处理

(pytorch) jetson@ubuntu:~/torch/torchvision$ OPENBLAS_CORETYPE=ARMV8  python3 setup.py install --user

3.验证

jetson@jetson-desktop:~/torch$ python3
Python 3.6.9 (default, Mar 10 2023, 16:46:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.10.0
>>> print(torch.cuda.is_available())
True
>>> exit()
jetson@jetson-desktop:~/torch$

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值