Commit eb9442e0 by Siva Committed by Tianqi Chen

[Convolution] Error while importing onnx model with weights. (#345)

* [Convolution] Error while imported onnx model has weights.

Fix the use_bias based on the input parameters to use bias (Ex: sqeezenet). Ref #336

* Review corrections.
parent ffcb2a5e
...@@ -95,7 +95,7 @@ def _conv(): ...@@ -95,7 +95,7 @@ def _conv():
'dilations': ('dilation', (0, 0)), 'dilations': ('dilation', (0, 0)),
'pads': ('padding', (0, 0), _revert_caffe2_pad), 'pads': ('padding', (0, 0), _revert_caffe2_pad),
'group': ('groups', 1)}, 'group': ('groups', 1)},
extras={'use_bias': False}, extras={'use_bias': len(inputs) == 3},
custom_check=_dimension_constraint())(inputs, attr) custom_check=_dimension_constraint())(inputs, attr)
return _impl return _impl
...@@ -113,7 +113,7 @@ def _conv_transpose(): ...@@ -113,7 +113,7 @@ def _conv_transpose():
'dilations': ('dilation', (0, 0)), 'dilations': ('dilation', (0, 0)),
'pads': ('padding', (0, 0), _revert_caffe2_pad)}, 'pads': ('padding', (0, 0), _revert_caffe2_pad)},
disables=['output_shape'], disables=['output_shape'],
extras={'use_bias': False}, extras={'use_bias': len(inputs) == 3},
custom_check=_dimension_constraint())(inputs, attr) custom_check=_dimension_constraint())(inputs, attr)
return _impl return _impl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment