【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解决方案,适用于学生党的部署方案)
375 0
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
208 1
|
5月前
|
SQL Apache Windows
Windows服务器80端口被占用的全面解决方案
在服务管理器中启动apache2服务,即可正常使用80端口。若系统中还安装了其他微软产品如sql等,也可尝试停止其服务进行测试,但请注意,SQL通常不会使用80端口,因此一般不会受到影响。以上就是关于80端口被system占用的详细解决方法,希望对你有所帮助。
|
3月前
|
安全 Linux iOS开发
Tenable Nessus 10.10 (macOS, Linux, Windows) - 漏洞评估解决方案
Tenable Nessus 10.10 (macOS, Linux, Windows) - 漏洞评估解决方案
329 0
Tenable Nessus 10.10 (macOS, Linux, Windows) - 漏洞评估解决方案
|
9月前
|
安全 Unix Linux
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
310 0
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
|
4月前
|
安全 Linux iOS开发
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
466 0
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
|
5月前
|
监控 数据安全/隐私保护 Windows
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
120 1
|
8月前
|
存储 安全 Linux
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
178 0
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
|
数据库 数据安全/隐私保护 Windows
Windows远程桌面出现CredSSP加密数据修正问题解决方案
【10月更文挑战第30天】本文介绍了两种解决Windows系统凭据分配问题的方法。方案一是通过组策略编辑器(gpedit.msc)启用“加密数据库修正”并将其保护级别设为“易受攻击”。方案二是通过注册表编辑器(regedit)在指定路径下创建或修改名为“AllowEncryptionOracle”的DWORD值,并将其数值设为2。
9863 3
解决方案-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可参考)
4583 0