onnxruntime: Shape mismatch warnings when using dynamic axis for time dimension

I’m exporting my PyTorch-trained convolutional speechrec model to ONNX, then I’m using onnxruntime (cpu) to run inference on a batch.

When using dynamic axis for the time dimension, I’m experiencing these strange warnings:

2019-12-28 14:28:56.147700928 [W:onnxruntime:Default, execution_frame.cc:335 AllocateMLValueTensorPreAllocateBuffer] Shape mismatch attempting to re-use buffer. {16,1024} != {16,1023}. Validate usage of dim_value (values should be > 0) and dim_param (all values with the same string should equate to the same size) in shapes in the model.
2019-12-28 14:28:56.147839016 [W:onnxruntime:Default, execution_frame.cc:335 AllocateMLValueTensorPreAllocateBuffer] Shape mismatch attempting to re-use buffer. {16,1024} != {16,1023}. Validate usage of dim_value (values should be > 0) and dim_param (all values with the same string should equate to the same size) in shapes in the model.
2019-12-28 14:28:56.147916603 [W:onnxruntime:Default, execution_frame.cc:335 AllocateMLValueTensorPreAllocateBuffer] Shape mismatch attempting to re-use buffer. {16,1023} != {16,1}. Validate usage of dim_value (values should be > 0) and dim_param (all values with the same string should equate to the same size) in shapes in the model.

Snippet to repro:

import numpy
import onnxruntime as rt

sess = rt.InferenceSession('model.onnx')
predict = sess.run(None, {'x': numpy.random.rand(1, 10000).astype(numpy.float32)})
print(predict)

model.onnx on my OneDrive: https://1drv.ms/u/s!Apx8USiTtrYmqfdiyT5heiUnoaCVNw?e=1Tsmvk

onnxruntime.version == 1.0.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

It seems to have helped! Case solved!