@tags caffe

在windows下使用caffe时,如果先前没有啥经验,会考虑按照官方文档中的例子跑一跑。比如mnist手写数字识别。

然后就会遇到这个问题:windows下怎么执行/examples/mnist/create_mnist.sh呢?

当然,你需要先编译了convert_mnist_data子项目,以及下载了mnist数据集。

ok,要执行的脚本create_mnist.sh是shell语法,不妨转写为python

# create_mnist.py
# by ChrisZZ import os
import shutil EXAMPLE='examples\\mnist'
DATA='data\\mnist'
BUILD='Build\\x64\\Release' BACKEND='lmdb' print "Createing "+BACKEND+"..." #rm -rf $EXAMPLE/mnist_train_${BACKEND}
#rm -rf $EXAMPLE/mnist_test_${BACKEND} path1=EXAMPLE+"\\mnist_train_"+BACKEND
path2=EXAMPLE+"\\mnist_test_"+BACKEND if os.path.exists(path1):
shutil.rmtree(path1)
if os.path.exists(path2):
shutil.rmtree(path2) s1=BUILD+"\\convert_mnist_data.exe"
s2=DATA+"\\train-images-idx3-ubyte"
s3=DATA+"\\train-labels-idx1-ubyte"
s4=EXAMPLE+"\\mnist_train_"+BACKEND
s5="--backend="+BACKEND cmd=s1+" "+s2+" "+s3+" "+s4+" "+s5
print cmd
os.system(cmd) t1=BUILD+"\\convert_mnist_data.exe"
t2=DATA+"\\t10k-images-idx3-ubyte"
t3=DATA+"\\t10k-labels-idx1-ubyte"
t4=EXAMPLE+"\\mnist_test_"+BACKEND
t5="--backend="+BACKEND cmd=t1+" "+t2+" "+t3+" "+t4+" "+t5
print "cmd2="+cmd
os.system(cmd)

然后,新开一个cmd控制台,cd到caffe根目录,执行:

python examples\mnist\create_mnist.py

【caffe】create_mnist.sh在windows下的解决方案的更多相关文章

  1. 【caffe】train_lenet.sh在windows下的解决方案

    @tags: caffe python 在windows下配置caffe后,跑mnist手写数字识别的例子.发现train_lenet.sh不能运行. 那就写个python脚本替代吧. step1 定 ...

  2. 【caffe】cifar10例子之quick_train.sh在windows下的解决方案

    @tags caffe 照例还是转写为python脚本: import os caffe_root=os.environ['caffe_root'] caffe_build=os.environ['c ...

  3. 【caffe】create_cifar10.sh在windows下解决方案

    @tags caffe python windows下配置caffe后,create_cifar10.sh无法执行,因为是shell脚本.那就看懂脚本意思,用python重写一个: # create_ ...

  4. MySql错误1045 Access denied for user 'root'@'localhost' (using password:YES) windows下的解决方案(忘记密码)

    1.进入管理员控制台停止mysql服务:net stop mysql; 2.进入mysql的安装路径,如我的安装路径为C:\Program Files\MySQL\MySQL Server 5.5,打 ...

  5. Windows 下 pdf2word 的可用软件记录

    因为用 latex 写的原稿,提交审阅的时候有 Word 版本的要求,只好找软件来转换.折腾了一整天的 Linux 下latex2html, latex2rtf 等两个曲线救国的方式来生成 Word ...

  6. Windows下caffe的配置和调用caffe库(一)

    一.Windows下caffe的配置: 1. 下载caffe官网提供的开发包,https://github.com/microsoft/caffe 2. 将caffe-master目录下的Window ...

  7. windows下caffe安装配置、matlab接口

    一.CommonSettings.props caffe下载后解压.源代码文件夹caffe-master,到该文件夹下的windows文件夹下,将CommonSettings.props.exampl ...

  8. 实践详细篇-Windows下使用Caffe训练自己的Caffemodel数据集并进行图像分类

    三:使用Caffe训练Caffemodel并进行图像分类 上一篇记录的是如何使用别人训练好的MNIST数据做训练测试.上手操作一边后大致了解了配置文件属性.这一篇记录如何使用自己准备的图片素材做图像分 ...

  9. Windows下caffe安装详解(仅CPU)

    本文大多转载自 http://blog.csdn.net/guoyk1990/article/details/52909864,加入部分自己实战心得. 1.环境:windows 7\VS2013 2. ...

随机推荐

  1. 5 个最好的3D游戏开发工具(转)

    转自:http://www.open-open.com/news/view/33a4f0 5 个最好的3D游戏开发工具 jopen 2012-11-19 22:56:21 • 发布 摘要:UDK(th ...

  2. ext 自带搜索功能

  3. 【转】Sql Server参数化查询之where in和like实现之xml和DataTable传参

    转载至: http://www.cnblogs.com/lzrabbit/archive/2012/04/29/2475427.html 在上一篇Sql Server参数化查询之where in和li ...

  4. [转]spring 注入静态变量

    原文: http://www.cnblogs.com/xing901022/p/4168124.html 今天碰到一个问题,我的一个工具类提供了几种静态方法,静态方法需要另外一个类的实例提供处理,因此 ...

  5. TelephonyManager类与PhoneStateListener

    public class TelephonyManager extends Object java.lang.Object      android.telephony.TelephonyManage ...

  6. 设置 java -jar 的进程显示名称

    有时候我们会用 nohup java -jar xxx.jar来将一些可执行的java application挂在后台,类似windows服务一样来运行.但是有一个不爽的地方,在linux终端里用jp ...

  7. vtk renderer / rendering 绘制

    1.在绘制窗口中绘制出物体(静态的)vtkRenderWindow * w=vtkRenderWindow::New();  w->AddRenderer(r);        for(int ...

  8. 牛X的CSS3

    See the Pen Dot Wave by Rich Howell (@roborich) on CodePen

  9. 开发备忘:AngularJS Syntax error, unrecognized expression in template file

    在写基于Angular的项目过程中,运行 grunt test的时候,一直给我蹦出这个错误,导致我的test一直跑不过,怎么试都是失败,经过重复排查,发现是因为template file中的html元 ...

  10. 基于DDD的.NET开发框架 - ABP日志Logger集成

    返回ABP系列 ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)”的简称. ASP.NET Boilerplate是一个用最佳实践和流行技术开发现代WEB应 ...