日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

TX2+python+pytorch install

發布時間:2025/3/15 python 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 TX2+python+pytorch install 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前半部分可以參考這一篇大神的https://blog.csdn.net/qq_33869371/article/details/88168202

Installing PyTorch on TX2
Trying to install PyTorch on the TX2 for Python3.5 is a bit of a mess since you need to build from source. If you're using Python2.7 or Python3.6, NVIDIA has been kind enough to provide wheels that you can install from. I briefly mention this process and include the wheels in this repository.

However, for the TX2, sadly it isn't this simple. We need to build PyTorch from source, and the latest branch of PyTorch has trouble trying to build without NCCL.

For now, I recommend using a previous version of PyTorch such as 0.4.1 or 0.5.0.

git clone http://github.com/pytorch/pytorch
git checkout 0.4.1
cd pytorch
git submodule update --init
sudo pip install -U setuptools
sudo pip install -r requirements.txt
#python setup.py build_deps
sudo python setup.py develop
sudo python setup.py install
After this, you should be able to import torch and run some basic commands to verify that it's working.

python3
import torch
print(torch.__version__)
print(torch.cuda.is_available())
Additionally, you will most likely need TorchVision for your project, which can be installed in a slightly easier manner:

pip3 install --no-deps torchvision

//
# clone pyTorch repo
git clone http://github.com/pytorch/pytorch
cd pytorch

# install prereqs
sudo pip install -U setuptools
sudo pip install -r requirements.txt

# Develop Mode:
#python setup.py build_deps?? ?#failed
sudo python setup.py develop

# Install Mode: ?(substitute for Develop Mode commands)
sudo python setup.py install

# Verify CUDA (from python interactive terminal)
# import torch
# print(torch.cuda.is_available())
# a = torch.cuda.FloatTensor(2).zero_()
# print(a)
# b = torch.randn(2).cuda()
# print(b)
# c = a + b
# print(c)

總結

以上是生活随笔為你收集整理的TX2+python+pytorch install的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。