Skip to content

Commit

Permalink
Assertに引っかかるため、padsが指定されてなかった場合にデフォルト値を渡すよう修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Masato Hori committed Mar 1, 2018
1 parent f8a242e commit 4188279
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions python/src/nnabla/utils/converter/onnx/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ def convert_to_function(node, base_name, func_counter):
cp.stride.dim.extend(strides[:dim])
if pads:
cp.pad.dim.extend(pads[:dim])
else:
# Set default values.
# Do we really need this? (Default value should be set by NNabla)
cp.pad.dim.extend([0 for _ in range(dim)])
if dilations:
cp.dilation.dim.extend(dilations[:dim])
else:
Expand Down
4 changes: 2 additions & 2 deletions python/test/utils/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def test_onnx_nnp_conversion_resnet50(tmpdir, nnp_fixture):
nnpex.export_nnp(p)
# read exported nnp and run network
nn_net = nnload.load([p])
pdb.set_trace()
#pdb.set_trace()
# set input data and run inference
net = nn_net.executors[exec_name].network
in_data = net.variables[in_name]
Expand All @@ -396,4 +396,4 @@ def test_onnx_nnp_conversion_resnet50(tmpdir, nnp_fixture):
c2 = c2out[out_name]
if show_output:
print(c2, nnout)
assert np.allclose(c2, nnout)
assert np.allclose(c2, nnout, atol=1e-5)

0 comments on commit 4188279

Please sign in to comment.