ONNX export failed on ATEn operator upsample bilinear2d

username: Diego
cooked: <p>I am trying to export <a href="https://github.com/CSAILVision/semantic-segmentation-pytorch" rel="nofollow noopener">this</a> segmentation model to ONNX. On export I get the error:</p>
<pre><code class="lang-auto">/home/diego/.pyenv/versions/gsoc/lib/python3.6/site-packages/torch/onnx/utils.py:662: UserWarning: ONNX export failed on ATen operator upsample_bilinear2d because torch.onnx.symbolic_opset9.upsample_bilinear2d does not exist
  .format(op_name, opset_version, op_name))
*** KeyError: 'upsample_bilinear2d'
</code></pre>
<p>I found this <a href="https://github.com/pytorch/pytorch/issues/22906" rel="nofollow noopener">issue</a> and this <a href="https://github.com/pytorch/pytorch/pull/20116" rel="nofollow noopener">fix</a> saying the problem was fixed on master. However I am working on PyTorch Nightly and I am still getting this error. In this model it comes its various <code>nn.function.interpolate</code> operations, same as in the example referenced in the issue.</p>
<p>I am also facing this problem when exporting the ‘fcn_resnet101’ from torchvision, since it has these operations as well.</p>

username: Vincent_Cheng
cooked: <p>Same issue here, have you found any solution?</p>

username: Diego
cooked: <p>Hey, I think someone found a workaround, but I havent tried it yet.  Check out the issue I referenced on the first post.</p>

username: Vincent_Cheng
cooked: <p>Thank you!. I managed to fix it with the solution in the issue.</p>

username: LLNLanLeN
cooked: <p><a class="mention" href="/u/vincent_cheng">@Vincent_Cheng</a> I’m currently having this issue, did you use the solution in this link:</p>
<aside class="onebox githubissue">
  <header class="source">
      <a href="https://github.com/pytorch/pytorch/issues/22906" target="_blank" rel="nofollow noopener">github.com/pytorch/pytorch</a>
  </header>
  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewbox="0 0 14 16" aria-hidden="true"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/pytorch/pytorch/issues/22906" target="_blank" rel="nofollow noopener">upsample_bilinear2d issue when exporting to onnx</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2019-07-16" data-time="10:05:04" data-timezone="UTC">10:05AM - 16 Jul 19 UTC</span>
      </div>


      <div class="user">
        <a href="https://github.com/bpinaya" target="_blank" rel="nofollow noopener">
          <img alt="bpinaya" src="https://avatars2.githubusercontent.com/u/2473733?v=4" class="onebox-avatar-inline" width="20" height="20">
          bpinaya
        </a>
      </div>
    </div>
  </div>
</div>

<div class="github-row">
  <p class="github-content">🐛 Bug
This issue is related to #20116 and #10942 and has to deal with upsample_bilinear2d
To Reproduce
Steps to reproduce the behavior:
This snippet...</p>
</div>

<div class="labels">
    <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">module: onnx</span>
    <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">triaged</span>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>