簡短不看版:保證電腦64位同時python(64bit),直接到https://download.pytorch.org/whl/torch_stable.html下相應(yīng)的輪子,pip install即可。
*torch和torchvision都要
————————————————————————————————
關(guān)于命名怎么看,個人參照這一篇:https://blog.csdn.net/lanchunhui/article/details/62417519
————————————————————————————————
詳細版:
首先,龜速網(wǎng)絡(luò),要下快需要外部工具輔助【懂的】
嘗試直接pip install torch暴力安裝, ERROR: Command errored out with exit status 1

網(wǎng)上說按官網(wǎng)(https://pytorch.org/)方式,ok

然后美滋滋復(fù)制黏貼,報錯,ERROR: Could not find a version that satisfies the requirement torch>=1.6.0 (from -r requirements.
查了一下,兩個辦法,一個是需要用國內(nèi)的鏡像源來下載
pip install selenium?-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
其中--trusted-host pypi.douban.com?的作用是獲得ssl證書的認(rèn)證【但我使用沒用】
另一種是直接下輪子,好,我下~

下了一堆,永遠報錯,ERROR: torch-1.5.1+cpu-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
經(jīng)過各種彎后,正準(zhǔn)備放棄win裸裝torch,改下anaconda繼續(xù)的時候,靈光一閃
發(fā)現(xiàn)自己的python的32位的重新下了一個64位的,繼續(xù)裝輪子

完美,成功!
以上~
以上歷時近一個多小時屬于睡眠的時間QAQ