<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">I installed PyTorch via conda in a Windows 10 machine, Python 3.6 environment.</p>
<p dir="auto">I get this error:<br>
ImportError: cannot import name 'caffe2_pb2'</p>
<p dir="auto">When trying to execute this tutorial:<br>
<a href="https://pytorch.org/tutorials/advanced/super_resolution_with_caffe2.html" rel="nofollow">https://pytorch.org/tutorials/advanced/super_resolution_with_caffe2.html</a></p>
<p dir="auto">Specifically when importing the Caffe2 ONNX Backend</p>
<h2 dir="auto">Traceback</h2>
<p dir="auto">Traceback (most recent call last):<br>
File "onnxLoader.py", line 9, in <br>
import caffe2.python.onnx.backend as onnx_caffe2_backend<br>
File "C:\Users\alejo\AppData\Local\conda\conda\envs\pyTorchEnv\lib\site-packages\caffe2\python_<em>init</em>_.py", line 2, in <br>
from caffe2.proto import caffe2_pb2<br>
ImportError: cannot import name 'caffe2_pb2'</p>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>PyTorch Version (e.g., 1.0): 1.0</li>
<li>OS (e.g., Linux): Windows 10</li>
<li>How you installed PyTorch (<code class="notranslate">conda</code>, <code class="notranslate">pip</code>, source): conda</li>
<li>Python version: 3.6.8</li>
<li>CUDA/cuDNN version: 9.0</li>
<li>GPU models and configuration: GeForce GTX 960M</li>
</ul>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">Reported by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/m3rlin45/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/m3rlin45">@m3rlin45</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from caffe2.python import workspace"><pre class="notranslate"><code class="notranslate">from caffe2.python import workspace
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 13:35:33) [MSC v.1900 64 bit (AMD64)] on win32
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; from caffe2.python import workspace
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Users\m3rlin45\Documents\foo\env\lib\site-packages\caffe2\python\__init__.py&quot;, line 2, in &lt;module&gt;
    from caffe2.proto import caffe2_pb2
ImportError: cannot import name 'caffe2_pb2'"><pre class="notranslate"><code class="notranslate">Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 13:35:33) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; from caffe2.python import workspace
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "C:\Users\m3rlin45\Documents\foo\env\lib\site-packages\caffe2\python\__init__.py", line 2, in &lt;module&gt;
    from caffe2.proto import caffe2_pb2
ImportError: cannot import name 'caffe2_pb2'
</code></pre></div>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Repro on a VM:</p>
<ul dir="auto">
<li>Spin up fresh windows server 2016 VM on azure</li>
<li>install python 3.6.7 from python.org</li>
<li>disable path limit during install</li>
<li>install virtualenv</li>
<li>install vs15 redist to help virtualenv work</li>
<li>set up a virtualenv and activated it</li>
<li>install torch via instructions on pytorch.org, windows, python 3.6, no cuda</li>
<li>open python</li>
<li>run: <code class="notranslate">from caffe2.python import workspace</code></li>
</ul>