注意
注意,如果您是通過搜索引擎發現的這篇文章,此筆記并不能幫到你,對不起qwq
安裝pytorch
在Pytorch下載頁面有很多種安裝方式,安裝pytorch可以通過conda的方式安裝,不過我安裝不上去,我選擇了pip安裝,不過這里依舊記錄一下換源方法,
1. conda方式
因為一些奇怪的原因,首先需要將Anaconda的源換為清華大學Tuna鏡像源,其實這個部分在Anaconda 鏡像使用幫助中已經講得很詳細了,唯一注意的一點是執行conda config --set show_channel_urls yes之后,生成的檔案是在C:\Users\你的用戶名這里,按照網頁上改就可以了,
改完之后打開Anaconda Prompt, 復制Pytorch下載頁面提供的命令即可安裝
2. pip方式
在Pytorch下載頁面選擇pip,復制到Anaconda Prompt即可安裝,不過如果出現ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory,復制下列代碼,并保存為.reg檔案后運行,然后再次運行下載指令,
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001
具體原因在這里在版本 1607 Windows 10中啟用長路徑
3. 安裝成功了嗎?
打開 Anaconda prompt,輸入python,運行
import torch
torch.cuda.is_available()
然后他告訴我No module named 'torch',
血壓高了
4. 我是sb
vscode有pytorch插件
以后再來看什么原因,先把我安裝成功的output內容保存下來,
(base) C:\Users\MaYeah>pip3 install torch==1.10.0+cu102 torchvision==0.11.1+cu102 torchaudio===0.10.0+cu102 -f https://download.pytorch.org/whl/cu102/torch_stable.html
Looking in links: https://download.pytorch.org/whl/cu102/torch_stable.html
Collecting torch==1.10.0+cu102
Using cached https://download.pytorch.org/whl/cu102/torch-1.10.0%2Bcu102-cp37-cp37m-win_amd64.whl (1486.0 MB)
Collecting torchvision==0.11.1+cu102
Using cached https://download.pytorch.org/whl/cu102/torchvision-0.11.1%2Bcu102-cp37-cp37m-win_amd64.whl (2.6 MB)
Collecting torchaudio===0.10.0+cu102
Using cached https://download.pytorch.org/whl/cu102/torchaudio-0.10.0%2Bcu102-cp37-cp37m-win_amd64.whl (336 kB)
Requirement already satisfied: typing-extensions in c:\users\mayeah\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from torch==1.10.0+cu102) (3.10.0.2)
Collecting numpy
Using cached numpy-1.21.3-cp37-cp37m-win_amd64.whl (14.0 MB)
Collecting pillow!=8.3.0,>=5.3.0
Using cached Pillow-8.4.0-cp37-cp37m-win_amd64.whl (3.2 MB)
Installing collected packages: torch, pillow, numpy, torchvision, torchaudio
WARNING: The scripts convert-caffe2-to-onnx.exe, convert-onnx-to-caffe2.exe and torchrun.exe are installed in 'C:\Users\MaYeah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script f2py.exe is installed in 'C:\Users\MaYeah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.21.3 pillow-8.4.0 torch-1.10.0+cu102 torchaudio-0.10.0+cu102 torchvision-0.11.1+cu102
安裝openCV
參考教程:VS2017配置opencv教程(超詳細!!!)
openCV下載頁面
我下的是4.5.4
https://www.cnblogs.com/q735613050/p/8969452.html
https://aistudio.baidu.com/aistudio/projectdetail/2545913?forkThirdPart=1
這兩個網址是我找到的一些教程 其中第一個是openCV的教程,另一個是百度paddleCV的在線實體,
先去寫數學作業了
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/342315.html
標籤:其他
下一篇:ffmpeg
