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常见报错以及解决方法

总结的不好的地方,希望路过的大哥能指点我一二,乃我荣幸之至,非常感谢。

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