python 如何查看pytorch版本
看代碼吧~
import torchprint(torch.__version__)
補(bǔ)充:pytorch不同版本安裝以及版本查看
一:基于conda安裝conda create --name pytorch_learn python=3.6.7#創(chuàng)建一個(gè)名為pytorch_learn的環(huán)境source activate pytorch_learn #進(jìn)入環(huán)境conda install pytorch=0.3.1 cuda80 -c soumith #安裝pytorch0.3.1+ cuda8.0(可自己指定)conda install -c soumith torchvision #安裝 torchvision#安裝常用的相關(guān)依賴庫conda install pandasconda install scikit-learnconda install torchnetexp:安裝pyorch1.0 + cuda9.0conda install pytorch torchvision cudatoolkit=9.0 -c pytorch二.基于pip安裝
安裝cuda8.0+torch1.0+python3.6,可更改鏈接名指定版本pip3 install https://download.pytorch.org/whl/cu80/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whlpip3 install torchvision三.檢查&查看版本
1.檢查
import torchimport torchvisionprint(torch.cuda.is_available())
2.查看版本
import torchprint(torch.__version__)四.可能會(huì)遇到的問題:
安裝pip3
步驟:
第1步:安裝setuptools
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26tar -zxvf setuptools-19.6.tar.gzcd setuptools-19.6python3 setup.py buildpython3 setup.py install
第2步:安裝pip3
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eebtar -zxvf pip-8.0.2.tar.gzcd pip-8.0.2python3 setup.py buildpython3 setup.py install
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教。
相關(guān)文章:
1. JS實(shí)現(xiàn)前端動(dòng)態(tài)分頁碼代碼實(shí)例2. 用Spring JMS使異步消息變得簡單3. 關(guān)于IDEA 2020.3 多窗口視圖丟失的問題4. PHP驗(yàn)證碼工具-Securimage5. js實(shí)現(xiàn)碰撞檢測6. 一文帶你徹底理解Java序列化和反序列化7. ASP基礎(chǔ)知識(shí)VBScript基本元素講解8. Python 利用Entrez庫篩選下載PubMed文獻(xiàn)摘要的示例9. 通過實(shí)例解析Python文件操作實(shí)現(xiàn)步驟10. ASP.NET MVC使用jQuery ui的progressbar實(shí)現(xiàn)進(jìn)度條

網(wǎng)公網(wǎng)安備