onnx
onnx copied to clipboard
encounting the below error, please help me
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?
I set the input as follows:
the dummy input data is as follows:
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.
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=...