提交 1048aee0 编写于 作者: G gaoyuan

Add input layer check

上级 520342ed
...@@ -1584,6 +1584,13 @@ class PriorBoxLayer(LayerBase): ...@@ -1584,6 +1584,13 @@ class PriorBoxLayer(LayerBase):
variance): variance):
super(PriorBoxLayer, self).__init__(name, 'priorbox', 0, inputs) super(PriorBoxLayer, self).__init__(name, 'priorbox', 0, inputs)
config_assert(len(inputs) == 2, 'PriorBoxLayer must have 2 input') config_assert(len(inputs) == 2, 'PriorBoxLayer must have 2 input')
input_layer = self.get_input_layer(1)
config_assert(
input_layer.type == 'data',
'Expecting the second input layer of an priorbox layer to be '
'a data layer')
config_assert(input_layer.width > 0, 'The data layer must set width')
config_assert(input_layer.height > 0, 'The data layer must set height')
self.config.inputs[0].priorbox_conf.min_size.extend(min_size) self.config.inputs[0].priorbox_conf.min_size.extend(min_size)
self.config.inputs[0].priorbox_conf.max_size.extend(max_size) self.config.inputs[0].priorbox_conf.max_size.extend(max_size)
self.config.inputs[0].priorbox_conf.aspect_ratio.extend(aspect_ratio) self.config.inputs[0].priorbox_conf.aspect_ratio.extend(aspect_ratio)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册