- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在训练一个检测模型,其中训练和测试数据是 3D NumPy 数组。当开始训练这个模型时发现了这种类型的错误。代码链接如下
model.fit_generator(generator=training_generator,
validation_data=validation_generator,
use_multiprocessing=True,
workers=6,
epochs=epochs,
callbacks=[checkpoint, tensorboard])
追溯(最近的调用最后):文件“/content/SpineFinder-master/train_detection_model.py”,第 25 行,位于洗牌=真)
文件“/content/SpineFinder-master/learning_functions/perform_learning.py”,第 57 行,在 perform_learning回调=[检查点,张量板])
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py”,第 324 行,在 new_func返回 func(*args, **kwargs)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py”,第 1479 行,在 fit_generator 中initial_epoch=initial_epoch)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py”,第 66 行,在 _method_wrapper 中返回方法(self, *args, **kwargs)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py”,第 848 行,适合tmp_logs = train_function(迭代器)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py”,第 580 行,在 call结果 = self._call(*args, **kwds)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py”,第 627 行,在 _call 中self._initialize(args, kwds, add_initializers_to=initializers)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py”,第 506 行,在 _initialize 中*args, **kwds))
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py”,第 2446 行,在 _get_concrete_function_internal_garbage_collectedgraph_function,_,_=self._maybe_define_function(args, kwargs)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py”,第 2777 行,在 _maybe_define_function 中graph_function = self._create_graph_function(args, kwargs)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py”,第 2667 行,在 _create_graph_function 中capture_by_value=self._capture_by_value),
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/func_graph.py”,第 981 行,在 func_graph_from_py_funcfunc_outputs = python_func(*func_args, **func_kwargs)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py”,第 441 行,wrapped_fn返回 weak_wrapped_fn()。包装(*args, **kwds)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/func_graph.py”,第 968 行,在包装器中提高 e.ag_error_metadata.to_exception(e)
ValueError: 在用户代码中:
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:571 train_function *outputs = self.distribute_strategy.run(/usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:951 运行 **返回 self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:2290 call_for_each_replica
return self._call_for_each_replica(fn, args, kwargs)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:2649 _call_for_each_replica
return fn(*args, **kwargs)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:543 train_step **
self.compiled_metrics.update_state(y, y_pred, sample_weight)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/compile_utils.py:391 update_state
self._build(y_pred, y_true)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/compile_utils.py:333 _build
self._set_metric_names()
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/compile_utils.py:353 _set_metric_names
m._name))
ValueError:找到两个同名的指标:recall
最佳答案
错误源于 detection.py 中的以下内容:
recall_background = km.binary_recall(label=0)
recall_vertebrae = km.binary_recall(label=1)
根据[1]和[2],km.binary_recall()实例化keras.metrics.recall()类。但是,如果没有 name
kwarg,两行都使用相同的名称 recall
。因此,为了避免这种情况,我的理解是您必须像这样指定 name
kwarg:
recall_background = km.binary_recall(name="recall_background", label=0)
recall_vertebrae = km.binary_recall(name="recall_vertebrae", label=1)
[1] - https://github.com/netrack/keras-metrics/blob/master/keras_metrics/\_\_init__.py#L34
[2] - https://github.com/netrack/keras-metrics/blob/master/keras_metrics/metrics.py#L150
关于keras - 值错误 : Found two metrics with the same name: recall,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62905851/
我们在日常使用电脑的时候,有些情况下可能会遇到出现提示found.000文件丢失损坏的情况。那么如果想要对found.000文件进行恢复,小编觉得可以在我们的文件夹选项中进行相关设置,找到被隐藏的文
下面的代码给出了“未找到”的输出。但我希望它能给出“发现”。我的错误在哪里? #include void compare(char *x, char *face); int i; int main(
为什么我的 git 不推送?我创建了存储库,但不断收到此消息: C:\Users\petey_000\rails_projects\first_app>git push -u github maste
我正在使用 Spring Boot 构建 Web API。端点之一采用 JSON 发布请求。我想在某些字段上设置验证消息。所以我在/src/main/resources 下添加了一个 Validati
我按照此页面上的说明进行操作: https://developers.facebook.com/docs/plugins/share-button/#settings 我得到一个工作共享对话框,但是当
如何在事件监听器中触发重定向到特定路由器? 有很多示例,但我找不到“GetResponseForExceptionEvent”的示例。例如,当我将 @roter 作为参数传递时,$this->rout
我使用下面的代码来发布 ssl 网络服务。当我浏览 https://localhost/ 它给我这个错误: 404 Not Found No context found for request 代码:
我正在尝试构建一个 docker 镜像但是正在获取 未找到 secret pip:未找到 对此有什么想法吗? docker 文件: FROM SHELL ["/bin/bash", "-c"] RU
我正在使用 indy TIDHTTP 编写一种方法来了解我在互联网上的服务器是否已关闭或同一服务器上的页面地址不可用。 我复制了 stackoverflow 上另一个线程中给出的建议: try I
我尝试将结果附加到列表中(如果找到),并将字符串“N/A”附加到列表中(如果未找到匹配项)。 show_version_lists 是来自各种网络设备的日志列表。 import re for resu
我在这里尝试加载关于我们的页面。但是找不到请求的页面。请提供此问题的解决方案。 查看: ">HOME /CI_timeline/
我不会问问题,而是回答一个问题,因为到目前为止我在网上找不到这个建议,并且自己刚刚弄清楚了这一点。分享是件好事,对吧? 所以在命令行上,我这样做了: sudo npm install -g cordo
我有一个脚本来处理一些参数并使用这些参数部署 Arm 模板,然后使用我的存储帐户中的 bacpac 文件创建数据库。当我的脚本尝试调用 cmdlet“New-AzSqlDatabaseImport”时
我使用“chrome://inspect”几天了。一切都很好。今天,由于某种原因,当我单击“检查”时,结果是“404 Not Found 找不到资源。” 这可能是什么原因? 我只能找到这个主题:htt
我的 Ubuntu 14.04 有一个奇怪的问题。我正在使用 Django-Rest-Framework 开发一个使用 Ionic 和 API 的移动应用程序。开发完成后,我下载了 jdk 和 And
我正在使用calabash-android-java测试使用 Xamarin 构建的混合应用程序。正如您在下面看到的,我能够查询 DOM 元素,甚至将一些信息记录到控制台,但是当我执行 touch 命
搜索功能非常有用,但我不确定如何为其添加某些“附加功能”。当有结果显示时,我还想说: "Your search returned x results." 后面是结果。 当没有结果显示时,我想说: "Y
我试图在我的应用程序中实现导航功能。当我尝试构建应用程序时,输出显示: Android resource linking failed /home/mateusz/AndroidStudioProje
我需要查询公共(public)项目提供的数据集。我创建了自己的项目并将他们的数据集添加到我的项目中。有一个表名为:domain_public .当我对该表进行查询时,我收到此错误: Query Fa
我对 Node.js 相当陌生,我使用的是下面页面中的教程。 http://www.9lessons.info/2017/02/create-restful-api-nodejs-mysql.html
我是一名优秀的程序员,十分优秀!