diff --git a/paddle/gserver/layers/DataLayer.cpp b/paddle/gserver/layers/DataLayer.cpp
index f6f4bf1d9cbc34644c3823d6392015242e21d9c1..67c49230367d8597860e3c32df434a16944f5daa 100644
--- a/paddle/gserver/layers/DataLayer.cpp
+++ b/paddle/gserver/layers/DataLayer.cpp
@@ -49,8 +49,13 @@ void DataLayer::copyDataToOutput(Argument& output) {
       output.ids->copyFrom(*data_.ids);
     }
   }
-  output.setFrameHeight(config_.height());
-  output.setFrameWidth(config_.width());
+  if (config_.height() && config_.width()) {
+    output.setFrameHeight(config_.height());
+    output.setFrameWidth(config_.width());
+  } else {
+    output.setFrameHeight(data_.getFrameHeight());
+    output.setFrameHeight(data_.getFrameHeight());
+  }
   output.cpuSequenceDims = data_.cpuSequenceDims;
   output.sequenceStartPositions = data_.sequenceStartPositions;
   output.subSequenceStartPositions = data_.subSequenceStartPositions;
diff --git a/python/paddle/trainer/config_parser.py b/python/paddle/trainer/config_parser.py
index f917ead680ac3d93ee36ea6f8767f7f66e58b2fb..0f4839e831504c870d816c0f8eedc1f8edc0456b 100644
--- a/python/paddle/trainer/config_parser.py
+++ b/python/paddle/trainer/config_parser.py
@@ -1931,10 +1931,9 @@ class MaxOutLayer(LayerBase):
         input_layer = self.get_input_layer(0)
         maxout_conf = self.config.inputs[0].maxout_conf
         parse_maxout(self.inputs[0].maxout, input_layer.name, maxout_conf)
-        self.set_layer_size(g_layer_map[input_layer.name].size /
-                            maxout_conf.groups)
-        self.set_layer_height_width(g_layer_map[input_layer.name].height,
-                                    g_layer_map[input_layer.name].width)
+        out_channels = maxout_conf.image_conf.channels / maxout_conf.groups
+        self.set_cnn_layer(name, g_layer_map[input_layer.name].height,
+                           g_layer_map[input_layer.name].width, out_channels)
 
 
 # key: cost type