配置kears使用环境--windows

中文说明:https://keras.io/zh/

https://www.tensorflow.org/install

打开conda ,输入

# Requires the latest pip
pip install --upgrade pip


# Current stable release for CPU and GPU
pip install tensorflow

安装CUDA Toolkit For Windows

https://docs.nvidia.com/deeplearning/cudnn/install-guide/#install-windows

安装cuDNN,选择配置点击下载
https://www.nvidia.com/Download/index.aspx?lang=en-us#

安装完成之后,需要将cuDNN中的文件CP到CUDA下

Copy <installpath>\cuda\bin\cudnn*.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vx.x\bin.
Copy <installpath>\cuda\include\cudnn*.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vx.x\include.
Copy <installpath>\cuda\lib\x64\cudnn*.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vx.x\lib\x64.

到这里都没有问题。

接下里是anaconda3 里面打开CMD下载keras 与 tensorflow。这里必须!!必须新建一个环境,似乎是默认的base环境下就有tensorflow,但是这里如果需要使用GPU的话,需要下载tensorflow-gpu

新建完环境之后,重新下载必须组件
pip install keras
conda install -c anaconda tensorflow-gpu

因为中文版的内容不多,所以这里参考英文版的内容,做了简单的测试。
https://keras.io/examples/vision/image_classification_from_scratch/

这里是代码,前后使用GPU与只用CPU。。。那个速度差简直是太大了。。。

因为https://github.com/jackfrued/Python-100-Days 教程里面数据分析和深度学习还没有开始更新。

所以现在开始学习https://www.deeplearning.ai/ 的内容,其实之前断断续续有了解过,但是没完整的看完。估计这周周五开始可以,下周结束之前看完他~

然后开始上手一些小项目吧~~

之后也许会更新一下学习内容。

另外,为什么选择Keras,不用Tensorflow与pytorch。最早了解到的是Tensorflow,后来了解pytorch,最近工业界的师兄推荐Keras。因为Keras使用起来更简单一些吧。我觉得就不想那么多了,就先用吧,不够再换好了,嘻嘻。

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Ecency