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

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

@tags caffe python

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

# create_cifar10.py
# by ChrisZZ

import os
import shutil

EXAMPLE="examples\\cifar10"
DATA="data\\cifar10"
DBTYPE="lmdb"

print "Creating "+DBTYPE+"..."

path1=EXAMPLE+"\\cifar10_train_"+DBTYPE
path2=EXAMPLE+"\\cifar10_test_"+DBTYPE

if os.path.exists(path1):
    shutil.rmtree(path1)
if os.path.exists(path2):
    shutil.rmtree(path2)

caffe_build=os.environ['caffe_build']
cmd1=caffe_build+"\\convert_cifar_data.exe "+DATA+" "+EXAMPLE+" "+DBTYPE
print cmd1
os.system(cmd1)

print "Computing image mean..."

cmd2=caffe_build+"\\compute_image_mean.exe --backend="+DBTYPE+" "+EXAMPLE+"\\cifar10_train_"+DBTYPE+" "+EXAMPLE+"\\mean.binaryproto"
print cmd2
os.system(cmd2)

然后在目录执行:

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