From 9a243d7a23d4c520ae0174232ac874879e2e4e9a Mon Sep 17 00:00:00 2001 From: Zhizhong Su Date: Wed, 14 Dec 2016 13:06:38 +0000 Subject: [PATCH] fix a few bugs related to frame size. --- paddle/gserver/layers/DataLayer.cpp | 2 +- paddle/parameter/Argument.cpp | 2 ++ proto/ModelConfig.proto | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/gserver/layers/DataLayer.cpp b/paddle/gserver/layers/DataLayer.cpp index 66f0606a3..3551df4e1 100644 --- a/paddle/gserver/layers/DataLayer.cpp +++ b/paddle/gserver/layers/DataLayer.cpp @@ -54,7 +54,7 @@ void DataLayer::copyDataToOutput(Argument& output) { output.setFrameWidth(config_.width()); } else { output.setFrameHeight(data_.getFrameHeight()); - output.setFrameHeight(data_.getFrameHeight()); + output.setFrameWidth(data_.getFrameWidth()); } output.cpuSequenceDims = data_.cpuSequenceDims; output.sequenceStartPositions = data_.sequenceStartPositions; diff --git a/paddle/parameter/Argument.cpp b/paddle/parameter/Argument.cpp index e91daa371..65d01a157 100644 --- a/paddle/parameter/Argument.cpp +++ b/paddle/parameter/Argument.cpp @@ -245,6 +245,8 @@ int32_t Argument::resizeAndCopyFrom(const Argument& src, bool useGpu, hl_stream_t stream) { dataId = src.dataId; + frameWidth = src.frameWidth; + frameHeight = src.frameHeight; if (!src.sequenceStartPositions) { // non-sequence input, copy samples directly diff --git a/proto/ModelConfig.proto b/proto/ModelConfig.proto index b34e1ebde..552af71e7 100644 --- a/proto/ModelConfig.proto +++ b/proto/ModelConfig.proto @@ -245,7 +245,7 @@ message ImageConfig { // The size of input feature map. required uint32 img_size = 8; - required uint32 img_size_y = 9; + optional uint32 img_size_y = 9; } message LayerInputConfig { -- GitLab