【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
目录
相关文章
|
3月前
|
Java 虚拟化 Docker
你还在为买不起云服务器而烦恼吗?(本地化部署windows解决方案,适用于学生党的部署方案)
你还在为买不起云服务器而烦恼吗?(本地化部署windows解决方案,适用于学生党的部署方案)
102 0
|
18天前
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
22 1
|
3月前
|
NoSQL Redis Windows
windows环境启动redis-server.exe出现闪退问题解决方案(亲测有效)
windows环境启动redis-server.exe出现闪退问题解决方案(亲测有效)
211 0
|
1月前
|
Windows
windows server 2019 安装NET Framework 3.5失败,提示:“安装一个或多个角色、角色服务或功能失败” 解决方案
windows server 2019 安装NET Framework 3.5失败,提示:“安装一个或多个角色、角色服务或功能失败” 解决方案
|
1月前
|
存储 Windows
windows server 2019 云服务器看不见硬盘的解决方案
windows server 2019 云服务器看不见硬盘的解决方案
|
1月前
|
弹性计算 安全 数据安全/隐私保护
远程桌面连接Windows实例,提示“为安全考虑,已锁定该用户账户,原因是登录尝试或密码更改尝试过多”错误解决方案
远程桌面连接Windows实例,提示“为安全考虑,已锁定该用户账户,原因是登录尝试或密码更改尝试过多”错误解决方案
160 0
|
3月前
|
Java Android开发 Windows
Java for Windows Missing问题原因分析以及完美解决方案
Java for Windows Missing问题原因分析以及完美解决方案
20 0
|
10月前
|
Windows
【Windows】bad_pool_caller蓝屏故障解决方案
【Windows】bad_pool_caller蓝屏故障解决方案
548 0
【Windows】bad_pool_caller蓝屏故障解决方案
|
5月前
|
Windows
软件打不开,文件找不到了,如何找到隐藏文件?(windows和mac解决方案)
软件打不开,文件找不到了,如何找到隐藏文件?(windows和mac解决方案)
软件打不开,文件找不到了,如何找到隐藏文件?(windows和mac解决方案)
|
6月前
|
存储 缓存 API
[总结]Windows Crypto API 自动更新根证书问题原因及解决方案
[总结]Windows Crypto API 自动更新根证书问题原因及解决方案