Do I need torch for pytorch?

username: FaultyBagnose
cooked: <p>I run Pycharm on Windows 10 and experience problems with torch, as it suddenly fails to import after I install a new version of pytorch and what not. I’ve googled a bit, and others seem to have similar problems. I’ll probably be able to solve them if I must, but my question now is: “Do I have to?”. Can I run pytorch nn-models without torch? I have some torch.nn models lying around; can I port them to pytorch easily? I notice that pytorch tutorials tend to use torch, but this is maybe for historic reasons?</p>
<p>Fredrik Dahl</p>

username: peterjc123
cooked: <aside class="quote no-group" data-username="FaultyBagnose" data-post="1" data-topic="81964">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/f/96bed5/48.png" class="avatar"> FaultyBagnose:</div>
<blockquote>
<p>fails to import after I install a new version of pytorch</p>
</blockquote>
</aside>
<p>Could you please provide some detailed logs?</p>
<aside class="quote no-group" data-username="FaultyBagnose" data-post="1" data-topic="81964">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/f/96bed5/48.png" class="avatar"> FaultyBagnose:</div>
<blockquote>
<p>Can I run pytorch nn-models without torch?</p>
</blockquote>
</aside>
<p>Do you mean you want to comment out <code>import torch.nn</code> in your code to workground this problem? It won’t work because in Python, <code>torch</code> refers to PyTorch.</p>
<aside class="quote no-group" data-username="FaultyBagnose" data-post="1" data-topic="81964">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/f/96bed5/48.png" class="avatar"> FaultyBagnose:</div>
<blockquote>
<p>I notice that pytorch tutorials tend to use torch, but this is maybe for historic reasons?</p>
</blockquote>
</aside>
<p>Well, maybe it is because <code>pytorch</code> is already registered in PyPI before the release of the PyTorch.</p>

username: km_proton
cooked: <p>try using jupiter notebook and if the problem exists</p>

username: FaultyBagnose
cooked: <p>Thanks for the advice, but it didn’t really answer my question, so I suspect my question is silly or ill defined. Some sources say that they stopped developing torch in 2018, and that the same kind of neural net functionality is implemented independently in pytorch.</p>
<p>My question is: If I (for some odd reason) never succeed in importing torch, can I still make neural net models in pytorch?<br>
Can I use pytorch without torch?</p>
<p>Fredrik</p>

username: theairbend3r
cooked: <p>Yes. You can build neural-networks in PyTorch without manually installing torch.</p>
<p>Check out the installation page for PyTorch =&gt; <a href="https://pytorch.org/get-started/locally/" rel="nofollow noopener">https://pytorch.org/get-started/locally/</a></p>
<p>I’m not sure if about porting torch models into Pytorch. Maybe look into ONNX.</p>

username: FaultyBagnose
cooked: <p>Sorry guys, I think I get it now. Since the conda install command refers to ‘pytorch’ and my Python code goes ‘import torch’ (rather than ‘import pytorch’), I assumed the import statement referred to (a Python wrapped) Lua torch. I guess the ‘py’ of ‘pytorch’ is skipped since we all know we’re writing Python :-).  This is what happens to you (i.e. me) when you copy sample code blindly.</p>
<p>I now think my problem may be with Conda. When I install a package, it giver this warning:</p>
<p>==&gt; WARNING: A newer version of conda exists. &lt;==<br>
current version: 4.5.11<br>
latest version: 4.8.3<br>
Please update conda by running<br>
$ conda update -n base -c defaults conda</p>
<p>But when I run the suggested command, it reproduces the warning, and claims all is installed:<br>
==&gt; WARNING: A newer version of conda exists. &lt;==<br>
current version: 4.5.11<br>
latest version: 4.8.3<br>
Please update conda by running<br>
$ conda update -n base -c defaults conda<br>
# All requested packages already installed.</p>
<p>I guess I should reinstall (Ana)conda?</p>

username: FaultyBagnose
cooked: <p>Apparently my problem was that pytorch required Python 3.5, while I had upgraded to 3.6.</p>