layer { name: "cifar" type: "Data" top: "data" top: "label" include { phase: TRAIN } transform_param { mean_file: "examples/cifar10/mean.binaryproto" } data_param { source: "examples/cifar10/cifar10_train_lmdb" batch_size: 100 backend: LMDB } }
transform_param { # 实际上就是1/255, 即将输入数据由0-255归一化到0-1之间 scale: 0.00390625 # randomly horizontally mirror the image # 1表示开启镜像,0表示关闭,也可用ture和false来表示 mirror: 1 # corp a ‘crop_size‘x ‘corp_size‘patch: # -at random during training # -from the center during testing # 剪裁一个 227*227的图块,在训练阶段随机剪裁,在测试阶段从中间裁剪 crop_size: 227 # substract mean value(RGB three channel) 用一个配置文件来进行均值操作 mean_file: "examples/cifar10/mean.binaryproto" # mean_value: 104 # mean_value: 117 # mean_value: 123 }
layer { name: "mnist" type: "Data" top: "data" top: "label" include { phase: TRAIN } transform_param { scale: 0.00390625 } data_param { source: "examples/mnist/mnist_train_lmdb" batch_size: 64 backend: LMDB } }
template <typename Dtype> DataLayer<Dtype>::DataLayer(const LayerParameter& param) : BasePrefetchingDataLayer<Dtype>(param), reader_(param) { }
void DataReader::Body::InternalThreadEntry() { shared_ptr<db::DB> db(db::GetDB(param_.data_param().backend())); db->Open(param_.data_param().source(), db::READ); shared_ptr<db::Cursor> cursor(db->NewCursor()); vector<shared_ptr<QueuePair> > qps; try { int solver_count = param_.phase() == TRAIN ? Caffe::solver_count() : 1; // To ensure deterministic runs, only start running once all solvers // are ready. But solvers need to peek on one item during initialization, // so read one item, then wait for the next solver. for (int i = 0; i < solver_count; ++i) { shared_ptr<QueuePair> qp(new_queue_pairs_.pop()); read_one(cursor.get(), qp.get()); qps.push_back(qp); } // Main loop while (!must_stop()) { for (int i = 0; i < solver_count; ++i) { read_one(cursor.get(), qps[i].get()); } // Check no additional readers have been created. This can happen if // more than one net is trained at a time per process, whether single // or multi solver. It might also happen if two data layers have same // name and same source. CHECK_EQ(new_queue_pairs_.size(), 0); } } catch (boost::thread_interrupted&) { // Interrupted exception is expected on shutdown } }
layer { top: "data" top: "label" name: "memory_data" type: "MemoryData" memory_data_param{ batch_size: 2 height: 100 width: 100 channels: 1 } transform_param { scale: 0.0078125 mean_file: "mean.proto" mirror: false } }
layer { name: "data" type: "HDF5Data" top: "data" top: "label" hdf5_data_param { source: "examples/hdf5_classification/data/train.txt" batch_size: 10 } }
layer { name: "data" type: "ImageData" top: "data" top: "label" transform_param { mirror: false crop_size: 227 mean_file: "data/ilsvrc12/imagenet_mean.binaryproto" } image_data_param { source: "examples/_temp/file_list.txt" batch_size: 50 new_height: 256 new_width: 256 } }
/path/to/images/img3423.jpg 2 /path/to/images/img3424.jpg 13 /path/to/images/img3425.jpg 8 ...
layer { name: "data" type: "WindowData" top: "data" top: "label" include { phase: TRAIN } transform_param { mirror: true crop_size: 227 mean_file: "data/ilsvrc12/imagenet_mean.binaryproto" } window_data_param { source: "examples/finetune_pascal_detection/window_file_2007_trainval.txt" batch_size: 128 fg_threshold: 0.5 bg_threshold: 0.5 fg_fraction: 0.25 context_pad: 16 crop_mode: "warp" } }
1. # 0 2. /home/xxx/0001.jpg 3. 641 4. 7 5. 1 1.0 353 356 393 396 6. 1 0.5 338 344 379 384 7. 2 0.7 339 336 379 376 8. 5 0 334 330 374 370 9. 4 1.0 330 324 370 364 10. 4 1.0 335 319 375 359 11. 4 1.0 341 313 381 353 12. # 1 13. /home/xxx/0002.jpg 14. 600 15. 3 16. 2 1.0 353 356 393 396 17. 2 0.5 338 344 379 384 18. 3 0.7 339 336 379 376
layer { name:"data" #设定当前layer名称为data type:"Input" #设置当前layer类型为Input top:"data" #设置当前layer输出blob名称为data #定义输入数据维度为 batchsize =1 channel=1 height=42 dim=42 input_param {shape: {dim: 1 dim: 1 dim: 42 dim:42}} }
layer { name: "data" type: "DummyData" top: "data" include { phase: TRAIN } dummy_data_param { data_filler { type: "constant" value: 0.01 } shape { dim: 32 dim: 3 dim: 227 dim: 227 } } } layer { name: "data" type: "DummyData" top: "label" include { phase: TRAIN } dummy_data_param { data_filler { type: "constant" } shape { dim: 32 } } }
原文:https://www.cnblogs.com/aiguilai/p/15211692.html