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)依賴庫(kù)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ì)遇到的問(wèn)題:
安裝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. ASP常用日期格式化函數(shù) FormatDate()2. ASP.NET Core實(shí)現(xiàn)中間件的幾種方式3. PHP設(shè)計(jì)模式中工廠模式深入詳解4. ASP中實(shí)現(xiàn)字符部位類似.NET里String對(duì)象的PadLeft和PadRight函數(shù)5. XML入門(mén)的常見(jiàn)問(wèn)題(二)6. 如何在jsp界面中插入圖片7. 在JSP中使用formatNumber控制要顯示的小數(shù)位數(shù)方法8. 利用CSS3新特性創(chuàng)建透明邊框三角9. 將properties文件的配置設(shè)置為整個(gè)Web應(yīng)用的全局變量實(shí)現(xiàn)方法10. jsp實(shí)現(xiàn)textarea中的文字保存換行空格存到數(shù)據(jù)庫(kù)的方法
