gpt4 book ai didi

python - PyCharm 异常中断不适用于 Theano

转载 作者:太空宇宙 更新时间:2023-11-03 12:06:19 27 4
gpt4 key购买 nike

当我导入 Theano 时,我无法让 PyC​​harm 停止在引发异常的代码行。

我的代码:

import theano
raise Exception()

我希望 PyCharm 调试器在 raise Exception() 行停止,但它抛出一个 RuntimeError 并退出调试器:

Traceback (most recent call last):
Error in sys.excepthook:
Traceback (most recent call last):
File "/homes/user/Downloads/pycharm-community-4.5.1/helpers/pydev/pydevd_breakpoints.py", line 89, in _excepthook
_original_excepthook(exctype, value, tb)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/link.py", line 58, in thunk_hook
__excepthook(type, value, trace)
File "/homes/user/Downloads/pycharm-community-4.5.1/helpers/pydev/pydevd_breakpoints.py", line 89, in _excepthook
_original_excepthook(exctype, value, tb)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/link.py", line 58, in thunk_hook
__excepthook(type, value, trace)
<...>
File "/usr/local/lib/python2.7/dist-packages/theano/gof/link.py", line 58, in thunk_hook
__excepthook(type, value, trace)
File "/homes/user/Downloads/pycharm-community-4.5.1/helpers/pydev/pydevd_breakpoints.py", line 84, in _excepthook
exception_breakpoint = get_exception_breakpoint(exctype, _handle_exceptions)
File "/homes/user/Downloads/pycharm-community-4.5.1/helpers/pydev/pydevd_breakpoints.py", line 65, in get_exception_breakpoint
exception_full_qname = get_exception_full_qname(exctype)
File "/homes/user/Downloads/pycharm-community-4.5.1/helpers/pydev/pydevd_breakpoints.py", line 53, in get_exception_full_qname
def get_exception_full_qname(exctype):
RuntimeError: maximum recursion depth exceeded

Original exception was:
Traceback (most recent call last):
File "/homes/user/Downloads/pycharm-community-4.5.1/helpers/pydev/pydevd.py", line 2357, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "/homes/user/Downloads/pycharm-community-4.5.1/helpers/pydev/pydevd.py", line 1777, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/homes/user/corp/python/projects/n_test.py", line 10, in <module>
raise Exception()
Exception

最佳答案

一个技巧是注释掉这一行 sys.excepthook = thunk_hook.../lib/python2.7/site-packages/theano/gof/link.py

关于python - PyCharm 异常中断不适用于 Theano,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31008673/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com