- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 TensorFlow CLI 调试器来识别在网络训练期间导致 NaN 的操作,但是当我尝试运行代码时出现错误:
_curses.error: cbreak() 返回错误
我正在通过 SSH 连接到的 Ubuntu 服务器上运行代码,并尝试遵循 this tutorial .
我曾尝试使用 tf.add_check_numerics_ops()
,但网络中的层包含 while 循环,因此不兼容。这是引发错误的代码部分:
import tensorflow as tf
from tensorflow.python import debug as tf_debug
...
#Prepare data
train_data, val_data, test_data = dataset.prepare_datasets(model_config)
sess = tf.Session()
sess = tf_debug.LocalCLIDebugWrapperSession(sess)
# Create iterators
handle = tf.placeholder(tf.string, shape=[])
iterator = tf.data.Iterator.from_string_handle(handle, train_data.output_types, train_data.output_shapes)
mixed_spec, voice_spec, mixed_audio, voice_audio = iterator.get_next()
training_iterator = train_data.make_initializable_iterator()
validation_iterator = val_data.make_initializable_iterator()
testing_iterator = test_data.make_initializable_iterator()
training_handle = sess.run(training_iterator.string_handle())
...
完整的错误是:
Traceback (most recent call last):
File "main.py", line 64, in <module>
@ex.automain
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/sacred/experiment.py", line 137, in automain
self.run_commandline()
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/sacred/experiment.py", line 260, in run_commandline
return self.run(cmd_name, config_updates, named_configs, {}, args)
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/sacred/experiment.py", line 209, in run
run()
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/sacred/run.py", line 221, in __call__
self.result = self.main_function(*args)
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/sacred/config/captured_function.py", line 46, in captured_function
result = wrapped(*args, **kwargs)
File "main.py", line 95, in do_experiment
training_handle = sess.run(training_iterator.string_handle())
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/tensorflow/python/debug/wrappers/framework.py", line 455, in run
is_callable_runner=bool(callable_runner)))
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/tensorflow/python/debug/wrappers/local_cli_wrapper.py", line 255, in on_run_start
self._run_start_response = self._launch_cli()
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/tensorflow/python/debug/wrappers/local_cli_wrapper.py", line 431, in _launch_cli
title_color=self._title_color)
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/tensorflow/python/debug/cli/curses_ui.py", line 492, in run_ui
self._screen_launch(enable_mouse_on_start=enable_mouse_on_start)
File "/home/enterprise.internal.city.ac.uk/acvn728/.local/lib/python3.5/site-packages/tensorflow/python/debug/cli/curses_ui.py", line 445, in _screen_launch
curses.cbreak()
_curses.error: cbreak() returned ERR
我对使用 Ubuntu(和 TensorFlow)还很陌生,但据我所知,服务器确实安装了 ncurses,这应该允许所需的基于 curses 的界面:
acvn728@america:~/MScFinalProject$ dpkg -l '*ncurses*' | grep '^ii'
ii libncurses5:amd64 6.0+20160213-1ubuntu1 amd64 shared libraries for terminal handling
ii libncursesw5:amd64 6.0+20160213-1ubuntu1 amd64 shared libraries for terminal handling (wide character support)
ii ncurses-base 6.0+20160213-1ubuntu1 all basic terminal type definitions
ii ncurses-bin 6.0+20160213-1ubuntu1 amd64 terminal-related programs and man pages
ii ncurses-term 6.0+20160213-1ubuntu1 all additional terminal type definitions
最佳答案
问题解决了!解决方案是改变
sess = tf_debug.LocalCLIDebugWrapperSession(sess)
到
sess = tf_debug.LocalCLIDebugWrapperSession(sess, ui_type="readline")
这类似于 this question 的解决方案,但我认为重要的是要注意它们的不同,因为 a) 它指的是不同的功能和不同的 API,并且 b) 我没有尝试从 IDE 运行,如该解决方案中所述。
关于python - 为什么我在使用 TensorFlow CLI Debugger 时得到 "_curses.error: cbreak() returned ERR"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52747655/
我正在使用 STM32CubeIDE 生成代码,但是当我开始调试时出现如下错误- STMicroelectronics ST-LINK GDB 服务器。版本 5.2.3 Copyright (c)
我正在使用 STM32CubeIDE 生成代码,但是当我开始调试时出现如下错误- STMicroelectronics ST-LINK GDB 服务器。版本 5.2.3 Copyright (c)
有什么区别 Debugger.Launch(); Debugger.Break(); ? 最佳答案 阅读文档,听起来如果附加了调试器,Launch 什么都不做——它实际上break(虽然我还没有验证这
我想知道是否应该在调用其他 Debug 和 Debugger 函数之前调用 if(Debugger.IsAttached)? if(Debugger.IsAttached) { Debugger.Br
我在我的应用程序中嵌入了单声道。该应用程序是支持插件的控制台应用程序。插件是 .NET 程序集。一切都很好,但我想调试它们。要在我的 C 代码中启用调试,我有: mono_set_dirs (ASSE
我有一个 PhoneGap 应用程序,它在 iOS 上运行良好,但在设置发布版本时,在 Android 上无法运行。 我正在使用 Phonegap CLI 创建我的应用程序。 $ phonegap -
我使用的是 Xcode 10.2.1 和 macOS Catalina Developer Beta 2。每当我尝试使用内存图调试器时,我都会收到此错误: Memory Graph Debugger:
这是一个示例网址: http://www.motherjones.com/mojo/2012/05/reince-priebus-lgbt-workplace-discrimination 当粘贴到
我正在 Mac 上的 IntelliJ 中设置远程调试器。我没有做任何修改就遵循了模板。然后我单击“调试 xxx”按钮。表明 "Error running 'Remote Debugger': Una
我想知道 debuggable true 语句的确切作用: // build.gradle android { buildTypes { deb
在 Visual Studio 中,我通常采用当前断点并将其移回上一行,但在 vscode 中我不知道该怎么做。 请指教。 最佳答案 有两个可能的命令可能会对您有所帮助 - 它们对我来说效果不佳,但您
在 Eclipse 中调试 J2EE 应用程序时,我确实看到了数百个线程。 但是,我对我的断点命中的单个线程感兴趣。 每次都来回找,很痛苦。 如何过滤掉未挂起的线程? 最佳答案 据我所知,没有一种简单
我正在尝试从我的 Android 设备(运行 One UI 2.0 的非根 Exynos Galaxy S9)中提取数据库文件,每次打开 Android Studio 3.6.2 -> 设备文件资源管
我使用Grok Debugger验证我的模式:%{DATA:evolution}%{DATA:value} 但问题是它不读取变量“值”的内容。 如果要使用两个连续的字符串,请问该如何做? 最佳答案 使
在 visual studio 中调试代码时,如果将鼠标悬停在某个属性上,将执行该属性的主体。当该代码正在执行时,是否可以确定它是由于调试器而不是由于正常代码执行而被执行的? 明确地说,我不是在寻找
Android 调试器没有进入我的位置。我正在按 F8(Step Over)完成调试,调试器跳转到:View.class,AsyncTask.class。 如果我不退出类(class),调试器会等待很
我刚刚发现了 debugger 关键字或用于 JavaScript 开发的任何东西,但我不清楚它是什么。当然它不是一个表达式,它没有任何值(value)。但是我需要在它后面放一个分号吗?它被定义为什么
几个月来我一直在默默地处理这个问题,最后我觉得有必要在这里问一下。 lldb 中的“po”通常会产生以下输出: (lldb) error: :3:1: error: use of unresolved
我有无处不在的 HelloWorldApp.java 文件 /** * The HelloWorldApp class implements an application that * simpl
我正在尝试从代码中获取应用程序的可调试属性值: packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
我是一名优秀的程序员,十分优秀!