最近学习了神经网络,也想搭建一个深度学习的环境,在神经网络学习书籍上看到了caffe框架,于是先搭建了caffe环境。
caffe
参考:一个caffe学习系列
包括安装步骤。但是,时间有点久远了,他的有些步骤行不通。需要参考一下其他博客。[更近的安装教程](https://www.cnblogs.com/pkjplayer/p/7302075.html),不过,学习系列能带我入门。
我是部署在 windows10 + vs2013 ,大约排错半天,成功!并且用mnist手写字进行了测试。
至于caffe的其他内容,先学习学习。
Keras
为了不影响python其他环境,特意用anconda建立了一个虚拟环境。
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
conda config --set show_channel_urls yes#添加镜像网站
conda create -n Keras python=3.6 #建立一个名称为Keras的虚拟环境python版本为3.6
conda env list #所有的虚拟环境
conda info --envs
conda activate Keras #激活Keras环境
conda deactivate #退出虚拟环境
pip install tenorflow
pip install Keras
测试代码:
#测试代码
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print (sess.run(hello))
conda install git # 安装git工具
git clone https://github.com/fchollet/keras.git #下载工程内容 cd keras/examples/ #进入代码路径
python mnist_mlp.py #用python运行程序
#作者:evolone
#来源:CSDN
#原文:https://blog.csdn.net/evolone/article/details/79072714
基本上能正常使用,就是有一点疑惑,在jupyter和Ipython不能使用,我猜测因该是环境问题,jupyter和Ipython用的不是虚拟环境的python。不过先这样吧,需要在解决。
结果