windows深度學習環境搭建

  下載軟件vs,pycharm,opencv,anaconda,配置各種環境,做個記錄。(win10 i5 顯卡GTX 1650)

  1.安裝anaconda

下載軟件:https://www.anaconda.com/distribution/#download-section

國內鏡像源:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

正常雙擊安裝,自己更換安裝目錄。安裝後 遇到的問題如下:

(1)在安裝後測試安裝終端輸入:conda --version
得到的結果:'conda' 不是內部或外部命令,也不是可運行的程序或批處理文件。

這是因爲環境變量導致的這個問題。xxx\anaconda\Scripts  目錄到剛剛安裝的anaconda下的Scripts --version

重新打開終端輸入:conda --version  顯示(我的是conda 4.8.2) 成功。

(2)安裝好以後,爲了各個項目不影響等, 我們要建立虛擬環境來進行版本控制。

終端輸入:conda create -n name python=3.6.9  自己起名字,然後指定Python版本。

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.。。。。。。。。。

這個時候我們要去C:\Users\xx文件夾下找一個叫condarc的文件修改裏面的內容。

但是 很多是受裏面是沒有這個文件的。這時候需要創建condarc文件命令

conda config --add channels r

再去該文件夾下查看.condarc文件已經出現。

複製下方語句到文件內

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
show_channel_urls: true
ssl_verify: false

重新按照之前方法創建。

虛擬環境成功。

激活虛擬環境,pip list出現下面的話

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
輸入:python -m pip install --upgrade pip 升級pip解決

然後需要啥就自己pip 安裝啦,要加源要不然很多都下載不下來  -i https://mirrors.aliyun.com/pypi/simple/

2.下載pycharm

地址:https://www.jetbrains.com/pycharm/download/

下載解壓安裝

3.安裝cuda

cuda_10.0.130_411.31_win10 下載雙擊安裝:https://developer.nvidia.com/cuda-downloads

cudnn-10.0-windows10-x64-v7.6.5.32解壓替換:https://developer.nvidia.com/cudnn

上面是空的路徑,放到不礙眼的地方。下面是剛剛虛擬環境的python.exe,兩個打鉤。

常用  :      -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
 

(1)阿里雲                           http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣                              http://pypi.douban.com/simple/
(3)清華大學                      https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中國科學技術大學        http://pypi.mirrors.ustc.edu.cn/simple/
(5)華中科技大學                http://pypi.hustunique.com/ 

import 一下TensorFlow 睡覺

OK!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章