Importing pytorch more than twice with running a file on the editor window causes a runtime error in the IPython console.
I'm using pytorch 0.4.0.
Expecting no exception. But some compiling/reloading existing module seems to cause an error.
Note that steps below are the dirty weird solution.
Traceback (most recent call last):
File "<ipython-input-3-bc7ab1fdfb9b>", line 1, in <module>
runfile('/Users/aaa/.spyder-py3/temp.py', wdir='/Users/aaa/.spyder-py3')
File "/usr/local/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "/usr/local/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/Users/aaa/.spyder-py3/temp.py", line 7, in <module>
import torch
File "/usr/local/lib/python3.6/site-packages/torch/__init__.py", line 184, in <module>
from .tensor import Tensor
File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 12, in <module>
class Tensor(torch._C._TensorBase):
File "/usr/local/lib/python3.6/site-packages/torch/tensor.py", line 170, in Tensor
""")
RuntimeError: method 'detach' already has a docstring
IPython >=4.0 : 6.3.1 (OK)
cython >=0.21 : 0.28.2 (OK)
jedi >=0.9.0 : 0.12.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.14.1 (OK)
pandas >=0.13.1 : 0.22.0 (OK)
psutil >=0.3 : 5.4.5 (OK)
pycodestyle >=2.3: 2.4.0 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.4 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.7.4 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
Thanks for reporting. We'll fix this in our next bugfix release.
Note to self: We need to add pytorch to the list of UMR blacklisted modules.
@dalthviz, please work on this one, following my note above.
I am using pytorch in spyder (installed by "pip install --user torch"). I got an error when re-running a file("RuntimeError: method 'detach' already has a docstring"), but disabling UMR resolved the problem. However, while looking for the reason, I noticed two things: