最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Anaconda配置pytorch-gpu虛擬環(huán)境的圖文教程

 更新時間:2020年04月16日 11:50:13   作者:星月㏇保潔  
這篇文章主要介紹了Anaconda配置pytorch-gpu虛擬環(huán)境步驟整理,本文分步驟通過圖文并茂的形式給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

1、更新NVIDIA驅(qū)動 

選對應(yīng)自己顯卡的驅(qū)動,(選studio版本,不要game版本)驅(qū)動鏈接 

2、添加Anaconda清華鏡像

方法一:anaconda命令替換

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --set show_channel_urls yes

(Mark)換回默認(rèn)源代碼:

conda config --remove-key channels

方法二:替換.condarc

show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
custom_channels:
 conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
 msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
 bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
 menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
 pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
 simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

3.創(chuàng)建虛擬環(huán)境

創(chuàng)建:
conda create -n 環(huán)境名 python=X.X
開啟:
activate 環(huán)境名
關(guān)閉:
conda deactivate
刪除:
conda remove -n 環(huán)境名 --all
添加包:
conda install -n 環(huán)境名 包名
移除包:
conda remove -n 環(huán)境名 包名

4. 安裝pytorch命令——對應(yīng)情況自選:命令代碼鏈接(pytorch官網(wǎng))

1.PIP安裝(推薦)

pip install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorch.org/whl/torch_stable.html

這個速度比conda穩(wěn)定 卡住了按回車好像還可以救回來

2.conda安裝(不推薦 老是中斷)

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch (要去掉-c pytorch 不然還是默認(rèn)源)
最終輸入命令:
conda install pytorch torchvision cudatoolkit=10.1

網(wǎng)絡(luò)在各處中斷 有時候48%又?jǐn)嗔?/p>

5.PIP安裝完之后測試

import torch
flag = torch.cuda.is_available()
print(flag)
 
ngpu= 1
# Decide which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0) else "cpu")
print(device)
print(torch.cuda.get_device_name(0))
print(torch.rand(3,3).cuda())

結(jié)果:被conda命令折騰一下午,終于被pip命令解救了!

總結(jié)

到此這篇關(guān)于Anaconda配置pytorch-gpu虛擬環(huán)境步驟整理的文章就介紹到這了,更多相關(guān)Anaconda pytorch-gpu虛擬環(huán)境內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Python Tkinter創(chuàng)建GUI應(yīng)用程序的示例

    Python Tkinter創(chuàng)建GUI應(yīng)用程序的示例

    Tkinter提供了豐富的功能和靈活的接口,讓開發(fā)者能夠輕松地構(gòu)建出各種各樣的圖形用戶界面,本文介紹了使用Python的Tkinter庫創(chuàng)建圖形用戶界面GUI應(yīng)用程序,感興趣的可以了解一下
    2024-12-12
  • 使用Python將Exception異常錯誤堆棧信息寫入日志文件

    使用Python將Exception異常錯誤堆棧信息寫入日志文件

    這篇文章主要介紹了使用Python將Exception異常錯誤堆棧信息寫入日志文件,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-04-04
  • 數(shù)據(jù)可視化Pyecharts的實(shí)際使用方式

    數(shù)據(jù)可視化Pyecharts的實(shí)際使用方式

    這篇文章主要介紹了數(shù)據(jù)可視化Pyecharts的實(shí)際使用方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-04-04
  • 詳解Python 循環(huán)嵌套

    詳解Python 循環(huán)嵌套

    這篇文章主要介紹了Python 循環(huán)嵌套的相關(guān)資料,文中示例代碼非常詳細(xì),幫助大家更好的理解和學(xué)習(xí),感興趣的朋友可以了解下
    2020-07-07
  • Python基礎(chǔ)之函數(shù)嵌套知識總結(jié)

    Python基礎(chǔ)之函數(shù)嵌套知識總結(jié)

    今天帶大家回顧python基礎(chǔ)知識,文中對Python函數(shù)嵌套作了非常詳細(xì)的知識總結(jié),對正在學(xué)習(xí)python基礎(chǔ)的小伙伴們很有幫助,需要的朋友可以參考下
    2021-05-05
  • Scrapy爬蟲Response子類在應(yīng)用中的問題解析

    Scrapy爬蟲Response子類在應(yīng)用中的問題解析

    這篇文章主要為大家介紹了Scrapy爬蟲Response它的子類(TextResponse、HtmlResponse、XmlResponse)在應(yīng)用問題解析
    2023-05-05
  • python time.sleep()是睡眠線程還是進(jìn)程

    python time.sleep()是睡眠線程還是進(jìn)程

    這篇文章主要介紹了python time.sleep()是睡眠線程還是進(jìn)程,通過實(shí)例代碼給大家介紹了Python Sleep休眠函數(shù) ,需要的朋友可以參考下
    2019-07-07
  • python3.x如何向mysql存儲圖片并顯示

    python3.x如何向mysql存儲圖片并顯示

    這篇文章主要介紹了python3.x如何向mysql存儲圖片并顯示問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-03-03
  • pydantic進(jìn)階用法示例詳解

    pydantic進(jìn)階用法示例詳解

    這篇文章主要為大家介紹了pydantic進(jìn)階用法示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-03-03
  • pytorch 中的重要模塊化接口nn.Module的使用

    pytorch 中的重要模塊化接口nn.Module的使用

    這篇文章主要介紹了pytorch 中的重要模塊化接口nn.Module的使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-04-04

最新評論

赣榆县| 新建县| 色达县| 绵竹市| 新余市| 遂溪县| 广西| 唐河县| 万安县| 江西省| 商水县| 左权县| 安国市| 阿图什市| 建德市| 福海县| 临邑县| 吉木萨尔县| 彩票| 马山县| 河北省| 沁阳市| 九龙坡区| 扶沟县| 邻水| 额敏县| 酉阳| 蕉岭县| 新乡县| 华蓥市| 枣阳市| 长岛县| 德江县| 平乡县| 江北区| 静宁县| 平乐县| 财经| 尼木县| 卢湾区| 成武县|