繁体   English   中英

如何在Mac OS X上的PyCharm中使用Tensorflow调试器?

[英]How can I use the Tensorflow debugger in PyCharm on Mac OS X?

我试图在PyCharm中使用Tensonflow调试器。 当我这样做时,我收到此错误: _curses.error: setupterm: could not find terminal

这是完整的追溯:

Traceback (most recent call last):
  File "/Users/mddrill/PycharmProjects/NumberReaderNN/number_reader.py", line 163, in <module>
    [optimizer, loss_func, train_prediction], feed_dict=feed_dict
  File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/wrappers/framework.py", line 411, in run
    self._run_call_count))
  File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/wrappers/local_cli_wrapper.py", line 210, in on_run_start
    self._prep_cli_for_run_start()
  File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/wrappers/local_cli_wrapper.py", line 228, in _prep_cli_for_run_start
    self._run_cli = ui_factory.get_ui(self._ui_type)
  File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/cli/ui_factory.py", line 56, in get_ui
    return curses_ui.CursesUI(on_ui_exit=on_ui_exit)
  File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/cli/curses_ui.py", line 263, in __init__
    self._screen_init()
  File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/cli/curses_ui.py", line 374, in _screen_init
    self._stdscr = curses.initscr()
  File "/anaconda/lib/python3.6/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
_curses.error: setupterm: could not find terminal

如果我从终端运行代码,调试器工作,所以这肯定是一个PyCharm问题。

我已经尝试了在另一个答案中看到的内容,即在运行>编辑配置>默认值> Python中将TERMINFO=/etc/terminfo到环境变量中,但这样做无效。 答案与linux有关,我在Mac OS X上。

如何让Tensonflow调试器在Mac OS X上的PyCharm中运行?

更新 :你是对的,这似乎是PyCharm中的一个未解决的问题: https ://youtrack.jetbrains.com/issue/PY-13062


OLD:需要设置适当的环境变量:

export TERM=xterm-new
export TERMINFO=/etc/terminfo

这里讨论了一个几乎相同的问题: 在使用curses的Python程序中,Setupterm无法找到终端

您可以进入“编辑配置”页面,然后选择“在输出控制台中模拟”。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM