theano版本的xnor源码使用(使用cpu)
来源:互联网 发布:logstash 性能优化 编辑:程序博客网 时间:2024/06/01 17:51
1下载xnor源码
theano-xnor-net的github地址:
https://github.com/iefiac/theano-xnor-net
下载后文件如下:
2安装依赖的工具
sudo apt-get install python-dev
sudo apt-get install python-pip
sudo apt-get install python-nose
sudo apt-get install g++
sudo apt-get install git
3安装numpy和scipy
3.1 numpy:
sudo pip install numpy
这样做估计pip速度会很慢,中间会掉线导致下载失败。使用国内镜像源进行安装:
可以在使用pip的时候加参数-i 地址
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。
几个镜像库:
新版ubuntu要求使用https源,要注意。
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
所以:pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider
3.2安装scipy:pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider
3.3先检测numpy:python -c "import numpy;numpy.test()"
后检测scipy :python -c "import scipy;scipy.test()"
无error且出现ok字样说明成功,否则需要卸载重新安装:
sudo apt-get remove python-numpy
sudo apt-get remove python-scipy
4安装theano:
sudo pip install Theano
注意上边的Theano是大写,下边的是小写
测试:python -c "import theano;theano.test()"
通过说明theano安装好了
5安装Lasagne:
Lasagne的github地址:https://github.com/Lasagne/Lasagne#installation
pip install -r https://raw.githubusercontent.com/
Lasagne/Lasagne/master/requirements.txt
pip install https://github.com/Lasagne/Lasagne/archive/master.zip
pip下载费劲可以使用国内的镜像源或者使用源码编译的方法也可以。
6安装pylearn2:
Pylearn2地址:http://deeplearning.net/software/pylearn2/#download-and-installation
6.1下载:git clone git://github.com/lisa-lab/pylearn2.git
进入polearn2目录,一般在home下,不行就搜:
sudo python setup.py develop
或
sudo python setup.py develop --user
6.2设置Pylearn2的数据地址
cd home
gedit .bashrc
文件名前的点表示是隐藏文件
在文件后面加上
export PYLEARN2_DATA_PATH=数据的路径
我的是export PYLEARN2_DATA_PATH=/home/qqq/pylearn2/data
7使用mnist
训练文件:
7.1必须将格式改为float32
打开终端,直接输入:sudo gedit ~/.theanorc
[global]
floatX=float32
device=cpu
保存退出
7.2需要编译opencv
7.3启动训练:进入train目录:bash train_mnist.sh
训练后生成.npz文件,记住该文件的路径。
8.test文件使用:
python test/mnist_test.py --model <model file path> --no <no of images to test> --mode <fixed OR float>
python 文件名 --model 模型路径 --no 检测的数量
(mnist最大10000)
--mode 默认float
可先使用python 文件名寻求帮助
mnist使用:
python mnist_test.py --model mnist_allxnor_mlp.npz --no 10000
- theano版本的xnor源码使用(使用cpu)
- ubuntu14.04安装theano的二进制网络theano-xnor-net
- Mac下使用源码编译安装TensorFlow CPU版本
- 测试theano是提示使用CPU而不是gpu问题
- 【Theano】使用Theano编写神经网络
- theano-xnor-net代码注释 cifar10_train.py
- Keras默认使用的后端模式(Theano/TensorFlow)设置
- 使用Anaconda在Linux下安装TensorFlow的CPU版本
- Theano中scan函数的使用
- Windows下pycharm使用theano的方法
- 配置使用GPU加速的Theano环境
- 使用c#获得cpu,硬盘的序列号(源码)
- 使用gpu加速theano
- 减少cpu的使用
- 监视 CPU 的使用
- Mac CPU版本tensorflow,Theano,tensorlayer,keras搭建
- theano-xnor-net代码注释2 cnn_utils.py
- theano-xnor-net代码注释3 xnor_net.py
- MySQL中的函数
- go template基本使用
- 每天一个linux命令
- 点(pt)和像素(px)的一些纪录
- 数值处理题库--Sprime
- theano版本的xnor源码使用(使用cpu)
- 遍历二叉树的三种情况-java实现
- 补充上传的一些细节上面的问题
- Generative Adversarial Nets(GAN) Tensorflow实现
- Predict Binding Sites of Transcription Factor && 富集分析
- 对象数组的内存图解
- zookeeper Watcher ZK状态 事件类型
- css边距及变态盒模型
- Android Sockdet