Transform data in MemoryDataLayer (branch dev/next)

749 views
Skip to first unread message

hleb...@gmail.com

unread,
Feb 19, 2015, 5:34:13 AM2/19/15
to caffe...@googlegroups.com
Hello,

In the file src/caffe/layers/memory_data_layer.cpp  (in the dev/next branches, not master) the methods MemoryDataLayer<Dtype>::AddMatVector and MemoryDataLayer<Dtype>::AddDatumVector use the data_transformer (that is exactly what I want). However, the method void MemoryDataLayer<Dtype>::Reset has the following line that forbids the definition of tranform parameters:

  // Refuse transformation parameters since a memory array is totally generic.
  CHECK(!this->layer_param_.has_transform_param()) <<
      this->type() << " does not transform data.";


I do not understand how these could be compatible ??? In practice, I must comment the lines in the method Reset() to be able to use the transform parmeters in AddMatVector() or AddDatumVector(). For information, my prototype is:

layers {
  name: "data"
  type: MEMORY_DATA
  top: "data"
  top: "label"
  memory_data_param {
    batch_size: 50
    channels: 3
    height: 227
    width: 227
  }
  transform_param {
    crop_size: 227
    mirror: false
    mean_file: "imagenet_mean.binaryproto"
  }


Best regards

H.

vpestret

unread,
Feb 19, 2015, 9:33:01 AM2/19/15
to caffe...@googlegroups.com
just comment this check out and it will work fine :)

Evan Shelhamer

unread,
Feb 19, 2015, 1:33:49 PM2/19/15
to hleb...@gmail.com, caffe...@googlegroups.com
Yeah, this check should have instead been a warning -- so I have relaxed it in https://github.com/BVLC/caffe/pull/1907.

Thanks for the report and happy brewing.

Evan Shelhamer

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/c93a84a3-ef56-49c9-aa5b-980cd34c501f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages