具体报错:
RuntimeError: Method run failed due to: [ONNXRuntimeError] : 1 : GENERAL ERROR : /onnxruntime_src/onnxruntime/core/providers/cpu/math/element_wise_ops.h:324 void onnxruntime::BroadcastIterator::Init(int64_t, int64_t) axis == 1 || axis == largest was false. Attempting to broadcast an axis by a dimension other than 1. -1 by 32
Stacktrace:
github同样的问题
https://github.com/microsoft/onnxruntime/issues/1840
解决方案
-
用torch.cat方式
src_seq = torch.cat([src_seq for _ in range(h)], dim=1)