首页 > 学院 > 开发设计 > 正文

caffe训练自己的数据

2019-11-14 11:30:39
字体:
来源:转载
供稿:网友
图像转为imdb格式 用的是caffe/build/tools/里面的 convert_imageset,参数如下:

convert_imageset [FLAGS] ROOTFOLDER/ LISTFILE DB_NAME

FLAG: -backend :lmdb/leveldb for storing the result, default: “lmdb” -gray (When this option is on, treat images as grayscale ones) type: bool default: false -resize_height (Height images are resized to) type: int32 default: 0 -resize_width (Width images are resized to) type: int32 default: 0 -shuffle (Randomly shuffle the order of images and their labels) type: bool default: false

参照例子,我写了一个shell文件 create.sh

#!/usr/bin/env sh# This script converts the image data into leveldb/lmdb format.TOOLS=/home/chuny/Downloads/caffe/build/toolsRESIZE_HEIGHT=256RESIZE_WIDTH=256DATADIR=/home/chuny/temp/datadirDATA=/home/chuny/temp/dataecho "Creating train leveldb..."GLOG_logtostderr=1 $TOOLS/convert_imageset / --resize_height=$RESIZE_HEIGHT / --resize_width=$RESIZE_WIDTH / --shuffle / $DATADIR/ / $DATA/train.txt / $DATA/train_imdb echo "Creating val leveldb..."GLOG_logtostderr=1 $TOOLS/convert_imageset / --resize_height=$RESIZE_HEIGHT / --resize_width=$RESIZE_WIDTH / --shuffle / $DATADIR/ / $DATA/val.txt / $DATA/val_imdb
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表