Failed to export an ONNX attribute 'onnx::Gather' Bug #34780
Labels
module: onnx
Related to torch.onnx
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
🐛 Bug
While trying to convert resnet18 based pytorch model from here. Below error comes up:
To Reproduce
Steps to reproduce the behavior:
Also download the model weights 79999_iter.pth from the repo page and place it in res/cp.
Expected behavior
Should not produce any errors during conversion
Environment
collect_env output:
Additional context
I added
print (v.node ())
to symbolic_helper.py just before the runtime error is raised to see what's causing the error.This is the output:
%595 : Long() = onnx::Gather[axis=0](%592, %594) # /content/drive/My Drive/Collab/fp/model.py:111:0
And that line in 111 in model.py is:
avg = F.avg_pool2d(feat32, feat32.size()[2:])
Based on my further research I found this source stating that:
The source suggests the following changes:
From this:
To this:
This change however yield other errors
cc @houseroad @spandantiwari @lara-hdr @BowenBao @neginraoof
The text was updated successfully, but these errors were encountered: