記一次pytorch安裝過程
來自專欄機器學習演算法與自然語言處理
21 人贊了文章
由於換了新環境,需要重新在伺服器上安裝pytorch0.3(目前代碼還沒有遷移到最新版本)。
於是來到了官網,敲出了下面命令:
pip3 install torch==0.3.1 torchvision
然後在下載相關庫的時候非常之慢,最後報錯了,在網上查了資料之後,推薦我使用清華源,那麼如何更改為清華源呢,方法如下:
使用pip的時候加參數-i https://pypi.tuna.tsinghua.edu.cn/simple
舉個例子:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent
這樣就會從清華這邊的鏡像去安裝gevent庫。
於是乎,我這麼去做了,把命令改為:
pip install Simple Index torch==0.3.1 torchvision
安靜的等待一小會,爆出了下面的問題:

於是我立馬拿著最後一個錯誤信息:
Cannot determine archive format of /tmp/pip-req-build-o64840jh
放到谷歌查了一下,查到了這篇文章:
小紅菌:pip mirror install problem裡面寫到:
I found that I am using the old command, change the command to said in the official guide,it works.
於是我按照它的方法將命令改為:
pip install --index-url Simple Index torch==0.3.1 torchvision
等了一小會之後,出現了
Successfully installed torch-0.3.1 torchvision-0.2.1
而且速度確實挺快的!
推薦閱讀:
※練習題︱基於今日頭條開源數據(二)——兩款Apriori演算法實踐
※周志華四問大學人工智慧教育:不應在現有學科框架下修修補補
※深度學習在文本分類中的應用
※softmax回歸
※數據挖掘 | 50個免費數據集收錄
TAG:PyTorch | 機器學習 | 深度學習DeepLearning |
