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

简介: @tags: caffe python在windows下配置caffe后,跑mnist手写数字识别的例子。发现train_lenet.sh不能运行。那就写个python脚本替代吧。step1定义两个环境变量,请自行添加并替换成你的目录:caffe_build D:\lib\caffe-ma...

@tags: caffe python

在windows下配置caffe后,跑mnist手写数字识别的例子。发现train_lenet.sh不能运行。

那就写个python脚本替代吧。

step1

定义两个环境变量,请自行添加并替换成你的目录:

caffe_build D:\lib\caffe-master\Build\x64\Release
caffe_root D:\lib\caffe-master

step2

在\examples\mnist\下新建train_lenet.py:

# train_lenet.py

import os

caffe_root=os.environ['caffe_root']
caffe_build=os.environ['caffe_build']

cmd=caffe_build+"\\caffe.exe train --solver="+caffe_root+"\\examples\\mnist\\lenet_solver.prototxt"
os.system(cmd)

step3

在目录下执行:(一定要在这个目录下)

python examples\mnist\train_lenet.py
目录
相关文章
|
Java 虚拟化 Docker
你还在为买不起云服务器而烦恼吗?(本地化部署windows解决方案,适用于学生党的部署方案)
你还在为买不起云服务器而烦恼吗?(本地化部署windows解决方案,适用于学生党的部署方案)
582 0
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
420 1
|
SQL Apache Windows
Windows服务器80端口被占用的全面解决方案
在服务管理器中启动apache2服务,即可正常使用80端口。若系统中还安装了其他微软产品如sql等,也可尝试停止其服务进行测试,但请注意,SQL通常不会使用80端口,因此一般不会受到影响。以上就是关于80端口被system占用的详细解决方法,希望对你有所帮助。
|
安全 Unix Linux
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
815 0
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
|
安全 Linux iOS开发
Tenable Nessus 10.10 (macOS, Linux, Windows) - 漏洞评估解决方案
Tenable Nessus 10.10 (macOS, Linux, Windows) - 漏洞评估解决方案
651 0
Tenable Nessus 10.10 (macOS, Linux, Windows) - 漏洞评估解决方案
|
安全 Linux iOS开发
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
946 0
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
|
监控 数据安全/隐私保护 Windows
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
334 1
解决方案-CMake error: error in configuration process, project files may be invalid(Windows&VS可参考)
解决方案-CMake error: error in configuration process, project files may be invalid(Windows&VS可参考)
5229 0
|
存储 安全 Linux
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
389 0
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
|
NoSQL Redis Windows
windows环境启动redis-server.exe出现闪退问题解决方案(亲测有效)
windows环境启动redis-server.exe出现闪退问题解决方案(亲测有效)
3014 0