gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 18:22:57 26 4
gpt4 key购买 nike

我正在尝试在 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 问题。

我已经尝试了我在另一个答案中看到的方法,即在 Run>Edit Configurations>Defaults>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

这里讨论了一个几乎相同的问题:Setupterm could not find terminal, in Python program using curses

关于python - 如何在 Mac OS X 上的 PyCharm 中使用 Tensorflow 调试器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43809025/

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