Python ide for pytorch

Milton_Wong: <p>Hi, all,</p>
<p>Which python ide would you suggest for pytorch?<br>
I’d like to link to corresponding pytorch implementation code when I click the keywords of pytorch. Also autocompletion function is desired.</p>

hughperkins: <p>Personal opinion: I’ve used Sublime for ages, and no major painpoints. Handles pep8, flake8, syntax highlighting. Can even handle auto-detecting tab indent sizes and such, which would have been handy in the old luatorch world <img src="//discuss.pytorch.org/images/emoji/apple/smiley.png?v=5" title=":smiley:" class="emoji" alt=":smiley:"></p>

tessler: <p>I highly recommend PyCharm, and it’s free if you are currently a student (they offer a free license to students).<br>
But I don’t think it has specific PyTorch integration (i.e autocomplete for modules / submodules).</p>

miguelvr: <p>+1 for PyCharm, I use it everyday (with pytorch)</p>

tom: <p>It isn’t an IDE, but I have come to like jupyter a lot, in particular since my pytorch computer is in the basement and I use my notebook computer to connect.<br>
It does tab completion but only shows the source code on ??.<br>
On the up side, it neatly includes graphical output.<br>
I did need a (very clumsy because it just replays everything) workaround for reconnecting <a href="https://github.com/jupyter/notebook/issues/1150" rel="nofollow noopener">https://github.com/jupyter/notebook/issues/1150</a> to be able to shut down the laptop and allow reconnecting.</p>
<p>Best regards</p>
<p>Thomas</p>

Lin_Sun: <p>Emacs with elpy, all the IDF features (autocomplete…), and it works under the console (pure text).</p>

samarth-robo: <p><a class="mention" href="/u/miguelvr">@miguelvr</a>, <a class="mention" href="/u/tessler">@tessler</a>, have you faced the issue where PyCharm debugging is very slow while printing / viewing tensors? On my system, printing even small ones takes more than 10s. Normal IPython debugging using Tracer()() is fine.<br>
I’ve reported it here: <a href="https://intellij-support.jetbrains.com/hc/en-us/requests/1034832" rel="nofollow noopener">https://intellij-support.jetbrains.com/hc/en-us/requests/1034832</a></p>

miguelvr: <p>My debug mode runs smoothly. Either in my local computer (Mac) or the deployment machine (Linux)</p>

antspy: <p>I have the same setup, and it works perfectly. The only issues I encountered is that it skips any breakpoints that are inside a backward() method of a custom-defined function (for whatever reason) but otherwise it’s very good!</p>

alexbellgrande: <p>I find Vim and tmux to be best if I’m working on a remote server. Otherwise I prefer Spyder.</p>

mcPytorch: <p>What spyder version are you using in combination with pytorch?<br>
I’m having problems getting it all working together. Not sure whether pytorch or spyder is causing the problem.<br>
Tried so far:<br>
-python 2.7<br>
-pytorch 0.12.1, 0.2.0, from source<br>
-ipython 4.10, 5.6<br>
-spyder 3.2.4</p>

alexbellgrande: <p>Current setup:<br>
Python 3.6<br>
pytorch 0.2.0_4<br>
ipython 5.3.0<br>
spyder 3.2.3</p>
<p>I’ve tried pytorch in multiple python/spyder versions in the past and have never had any problems.</p>

Tahir_Mujtaba: <p>can you please tell me the procedure to use pytorch in pycharm. I am trying to add the torch, pytorch library in pycharm but it shows error.</p>

Tahir_Mujtaba: <p>can u plz list the procedure for using pytorch in pycharm</p>

miguelvr: <p>chose an interpreter, I recommend you use a conda environment or a virtualenv, install pytorch in that env, and then it works just as any python library</p>

Tahir_Mujtaba: <p>yeah i got it installed . I have an Nvidia gpu with my machine , do i need to install Nvidia and cuda drivers separately before pytorch installation to use the GPU</p>

irustandi: <p>Yes, you need to have the appropriate GPU driver installed to use PyTorch with GPU.</p>

yhz5256: <p>vscode and vim <img src="https://discuss.pytorch.org/images/emoji/apple/smiley.png?v=5" title=":smiley:" class="emoji" alt=":smiley:"> <img src="https://discuss.pytorch.org/images/emoji/apple/grin.png?v=5" title=":grin:" class="emoji" alt=":grin:"></p>

Santhoshnumberone: <p>Depends on the kind of system you are using.<br>
Bigger RAM and good GPU PyCharm and pytorch awesome combination.<br>
Laptop i’m using core i5 8th gen, only 4GB RAM with Geforce MX150 2GB, have CUDA 10.0 on lubuntu, hard on system to use Pycharm and pytorch at same time.</p>
<p>Need to have only three applications open when i’m trying to train a NN.<br>
Terimal - to execute the file for training.<br>
Task Manager - to check the system usage or to kill a task.<br>
Sublime text - to edit the file.</p>
<p>Works like a charm.</p>

Lingyun_Li: <p>For those facing the slow debug/step issue, an easy fix is to change variable loading policy to  <code>On demand</code></p>
<p><a href="https://www.jetbrains.com/help/pycharm/variables-loading-policy.html" class="onebox" target="_blank" rel="nofollow noopener">https://www.jetbrains.com/help/pycharm/variables-loading-policy.html</a></p>