Hi all,

This is not strictly a Theano error, but it arises whenever you run the 
PyCharm debugger on any code that imports theano.

For some reason, when running in debug mode, with any code that imports 
theano, I get the additional error message:
Exception TypeError: TypeError("'NoneType' object is not callable",) in <
function _remove at 0x10e0f47d0> ignored

I am also unable to "break on exception", which is a useful feature when 
debugging code.

I guess Theano does something sneaky under the hood which unintentionally 
messes with PyCharm's debugger.

Example: When I run the following code in PyCharm's debugger:
import theano

def demo_theano_pycharm_error():
    raise Exception('My error')

demo_theano_pycharm_error()

I get the output:

/Users/peter/projects/spiking-experiments/venv/bin/python2.7 
"/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc 
--client 127.0.0.1 --port 61739 --file 
/Users/peter/projects/spiking-experiments/scratch/demo_theano_pycharm_error.py
/Users/peter/projects/spiking-experiments/venv/lib/python2.7/site-packages/IPython/utils/traitlets.py:5:
 
UserWarning: IPython.utils.traitlets has moved to a top-level traitlets 
package.
  warn("IPython.utils.traitlets has moved to a top-level traitlets 
package.")
pydev debugger: process 64000 is connecting

Connected to pydev debugger (build 139.1803)
Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", 
line 2217, in <module>
    globals = debugger.run(setup['file'], None, None)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", 
line 1643, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File 
"/Users/peter/projects/spiking-experiments/scratch/demo_theano_pycharm_error.py",
 
line 6, in <module>
    demo_theano_pycharm_error()
  File 
"/Users/peter/projects/spiking-experiments/scratch/demo_theano_pycharm_error.py",
 
line 4, in demo_theano_pycharm_error
    raise Exception('My error')
Exception: My error
Exception TypeError: TypeError("'NoneType' object is not callable",) in 
<function _remove at 0x10303e7d0> ignored

Process finished with exit code 1

When I remove the "import theano" from the beginning, I get

/Users/peter/projects/spiking-experiments/venv/bin/python2.7 
"/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc 
--client 127.0.0.1 --port 61755 --file 
/Users/peter/projects/spiking-experiments/scratch/demo_theano_pycharm_error.py
/Users/peter/projects/spiking-experiments/venv/lib/python2.7/site-packages/IPython/utils/traitlets.py:5:
 
UserWarning: IPython.utils.traitlets has moved to a top-level traitlets 
package.
  warn("IPython.utils.traitlets has moved to a top-level traitlets 
package.")
pydev debugger: process 64059 is connecting

Connected to pydev debugger (build 139.1803)
Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", 
line 2217, in <module>
    globals = debugger.run(setup['file'], None, None)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", 
line 1643, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File 
"/Users/peter/projects/spiking-experiments/scratch/demo_theano_pycharm_error.py",
 
line 4, in <module>
    demo_theano_pycharm_error()
  File 
"/Users/peter/projects/spiking-experiments/scratch/demo_theano_pycharm_error.py",
 
line 2, in demo_theano_pycharm_error
    raise Exception('My error')
Exception: My error

Process finished with exit code 1



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to