Im trying to import to tensorflow an onnx saved model from a pytorch implementation of efficientdet-d0 and I get the following error when I try to run a prediction or export the model :
ValueError: DepthwiseConv2D requires the stride attribute to contain 4 values, but got: 3 for ‘{{node depthwise}} = DepthwiseConv2dNative[T=DT_FLOAT, data_format=“NHWC”, dilations=[1, 1, 1, 1], explicit_paddings=[], padding=“VALID”, strides=[1, 1, 1]](transpose_4, Reshape_2)’ with input shapes: [?,?,?,?], [3,3,32,1].
code :
onnx_model = onnx.load(PATH + ‘model.onnx’)
onnx.checker.check_model(onnx_model)
tf_rep = prepare(onnx_model)
tf_rep.export_graph(“d0_s256_b32_ep400_TF.pb”)
or
onnx_model = onnx.load(PATH + ‘model.onnx’)
onnx.checker.check_model(onnx_model)
tf_rep = prepare(onnx_model)
tf_rep.run(Variable(torch.randn(32,3,256,256, dtype=torch.float32)))