onnx icon indicating copy to clipboard operation
onnx copied to clipboard

encounting the below error, please help me

Open githublsk opened this issue 2 years ago • 2 comments

when i covert pytoch model to onnx, the error occur as below, I think because entities and relations is a dict format data, which I set them with wrong shape? image I set the input as follows: image the dummy input data is as follows: image

githublsk avatar Jun 30 '22 09:06 githublsk

Hi @githublsk, According to the exporter doc, perhaps you need to add an empty dictionary in the end. Still, this error happened while using torch.onnx.export so it should be the question for the PyTorch-ONNX exporter. If my suggestion does not help, please file this issue in their repo (the exporter is under PyTorch) and tag ONNX instead to get faster/better assistance from the exporter experts.

jcwchen avatar Jul 01 '22 15:07 jcwchen

Dynamic axis means axis of a tensor. eneities and relations are not tensors so it may throw. If possible, I'd suggest to encode your data as tensors instead of dictionary; for example,

labels = torch.zero...
image= torch.zero...
starts= torch.tensor([1,3,4,5])...
ends=...
head=...
tail=...

wschin avatar Jul 01 '22 17:07 wschin