Python ML常用庫安裝-詳細滴

回憶一個段子:
程序員小黑:面試官你好,我精通java、python、C++、C、php、mysql、spark、IDEA等常用軟件 的 安裝與卸載
在這裏插入圖片描述
在這裏插入圖片描述
爲了以後能和麪試官面前吹水、起碼有點東西講喔,得總結一下這些機器學習常用庫的安裝,嘻嘻

更新pip:

pip install --upgrade pip
python -m pip install --upgrade pip

安裝keras

pip install keras

安裝sklearn:

pip install -U scikit-learn

安裝tensorflow:

官網:tensorflow官網
1.CPU版本:

pip install tensorflow-cpu
pip install tensorflow (這樣也是默認安裝cpu版本)
pip install tensorboard

2.GPU版本:

pip install tensorflow-gpu

安裝預覽版本(非穩定版本):

pip install tf-nightly-cpu  (不穩定版本)
pip install tf-nightly-cpu  (不穩定版本)

3.導入(import)tensorflow出現DDL問題:
vc_redist.x64.exe地址:下載地址

4.tensorflow的GPU版本前置cuda和cudnn要求GPU支持的要求

5. 可視化體驗tensorflow深度算法過程(可視化操作實現深度學習算法): 點進來
在這裏插入圖片描述

安裝pytorch:

官網:pytorch官網
1.CPU版本:

pip install torch==1.5.1+cpu torchvision==0.6.1+cpu
pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

2.GPU版本:
添加putorch的清華源:

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
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

安裝:

pip install torch==1.5.1+cu101 torchvision==0.6.1+cu101
官方源安裝如下:
pip install torch==1.5.1+cu101 torchvision==0.6.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html

或者直接:(此方式無需配置清華pytorch源)
pip install torch===1.3.0 torchvision===0.4.1 -i https://pypi.tuna.tsinghua.edu.cn/simple

安裝百度paddlepaddle

官網: 進來仔細看看,很詳細
講真的,個人覺得這個框架真的一點也不比上面那兩個差到哪去。
1.CPU版本

pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

conda install paddlepaddle

2.GPU版本:

pip install paddlepaddle-gpu==1.8.2.post107 -i https://mirror.baidu.com/pypi/simple

conda install paddlepaddle-gpu cudatoolkit=10.0

GPU版本需要安裝的cuda和cudnn安裝方法(naconda下):

0.參照表: 點擊進入
在這裏插入圖片描述
1.anaconda環境下,如果使用conda命令安裝gpu版本的TF或者pytorch等學習框架,那麼將會自動安裝cuda和cudnn:(這種方式在電腦不慢和網絡速度都好的情況建議使用,否則conda在搜索包的過程是很慢很慢很慢的!)

conda install tensorflow-gpu

2.根據框架的算力要求以及自己電腦的顯卡版本 下載cuda和cudnn安裝,並且配置環境變量即可。

OpenCV的安裝

 
pip install opencv-contrib-python

NLTK安裝

pip install NLTK

virtualenv的安裝

pip install virtualenv

fabric的安裝

 pip install fabric

matplotlib的安裝

pip install matplotlib

scikit-image的安裝

pip install scikit-image

pandas、numpy的安裝:

pip install pandas
pip install numpy

其它:

國內源集合-py源配置
conda常見報錯以及解決方法

總結的不好的地方,希望路過的大哥能指點我一二,乃我榮幸之至,非常感謝。

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