问题标签 [retinanet]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
98 浏览

tensorflow - keras 视网膜网络模型转换器到 tflite

我训练了一个用于类识别的模型。我使用 fizyr 的 Keras 进行训练:Fizyr - Keras Retinanet GitHub

我设法以优异的成绩完成了培训。我的目标是将获得的模型集成到android中。

我尝试使用此脚本转换模型:

但是当我将模型导入到android应用程序时,应用程序崩溃了。

任何人都知道如何帮助我将 keras .h5 模型转换为 .tflite 模型?

控制台输出:

2021-10-07 12:09:17.221 21554-21599/org.tensorflow.codelabs.objectdetection E/tflite:找不到内置操作码“MUL”版本“5”的操作。可能支持此内置函数的旧版本。您是否在使用带有较新模型的旧 TFLite 二进制文件?2021-10-07 12:09:17.221 21554-21599/org.tensorflow.codelabs.objectdetection E/tflite:注册失败。2021-10-07 12:09:17.234 21554-21599/org.tensorflow.codelabs.objectdetection E/AndroidRuntime:致命异常:DefaultDispatcher-worker-1 进程:org.tensorflow.codelabs.objectdetection,PID:21554 java.lang。 AssertionError:初始化 ObjectDetector 时发生错误:未找到内置操作码“MUL”版本“5”的操作。可能支持此内置函数的旧版本。您是否在使用带有较新模型的旧 TFLite 二进制文件?

access$runObjectDetection(MainActivity.kt:48) at org.tensorflow.codelabs.objectdetection.MainActivity$setViewAndDetect$1.invokeSuspend(MainActivity.kt:165) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33 ) 在 kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 在 kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) 在 kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt: 750) 在 kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) 在 kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-10-07 12:09:17.245 21554-21599/org.tensorflow.codelabs.objectdetection I/Process:发送信号。PID:21554 SIG:9 objectdetection.MainActivity$setViewAndDetect$1.invokeSuspend(MainActivity.kt:165) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler. kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-10-07 12:09:17.245 21554-21599/org.tensorflow.codelabs.objectdetection I/Process: 发送信号. PID:21554 SIG:9 objectdetection.MainActivity$setViewAndDetect$1.invokeSuspend(MainActivity.kt:165) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler. kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-10-07 12:09:17.245 21554-21599/org.tensorflow.codelabs.objectdetection I/Process: 发送信号. PID:21554 SIG:9 resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker .executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-10 -07 12:09:17.245 21554-21599/org.tensorflow.codelabs.objectdetection I/Process:发送信号。PID:21554 SIG:9 resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker .executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-10 -07 12:09:17.245 21554-21599/org.tensorflow.codelabs.objectdetection I/Process:发送信号。PID:21554 SIG:9 executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-10- 07 12:09:17.245 21554-21599/org.tensorflow.codelabs.objectdetection I/Process:发送信号。PID:21554 SIG:9 executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-10- 07 12:09:17.245 21554-21599/org.tensorflow.codelabs.objectdetection I/Process:发送信号。PID:21554 SIG:9

0 投票
0 回答
11 浏览

retinanet - 训练 fizyr/keras-retinanet 的数据集中图像的最大标签数?

我对训练有疑问,当我为我的数据集分离标签时,我的一些图像有超过 300 个标签,这是 RetinaNet 定义的最大检测数(下图示例,带有 567 个标签“Planta”)。我想知道这个数字是否超过 300 的限制会导致我的训练出现问题??

示例 XML 数据集图像

0 投票
1 回答
30 浏览

keras - 从 h5 转换为 tflite 后的坏形状数组

我通过 kerasretinanet(由 fizyr)训练了一个模型。我将其转换为 .tflite 但在查看 .tflite 模板信息模型信息时遇到问题:

tflife_input_details = tflife_model.get_input_details()

tflife_output_details = tflife_model.get_output_details()

将模型转换为 .tflite

训练:

如图所示,数组形状条目为 (1, 1, 1, 3)。这怎么可能?我在转换中做错了吗?这个模型目前在推理中不起作用吗?

更新:我的转换模型的结构: https ://imgur.com/a/j1ne2Na

0 投票
1 回答
68 浏览

python - 结合两种不同的深度学习模型进行评估

我有 2 种不同的深度学习模型用于缺陷检测。一种是对象检测模型,另一种是语义分割模型。目的是将两者集成到单一的预测算法中。我正在寻找结合这两个模型以预测结果的最佳方法。我主要想以组合形式评估这两个模型并计算平均平均精度(mAP)有什么办法可以做到。我无法评估,因为我在代码的预测部分被卡住了。

我做了一些修改。请提出任何更改。当我收到以下错误时。

任何帮助表示赞赏。先感谢您。

0 投票
1 回答
167 浏览

pytorch - AttributeError:“DataParallel”对象没有属性“副本”

我正在尝试恢复训练monkeyAI pytorch Retinanet。我已经加载了 .pt 文件而不是实际模型。更改在 Monk_Object_Detection/5_pytorch_retinanet/lib/train_detector.py 中进行,在其修改的地方检查“#change”。

当我从主函数调用 Model() 时,出现属性错误,如下所示:

错误:

请帮我解决问题!

0 投票
0 回答
33 浏览

object-detection - nvidiaretinanet-examples 训练脚本不工作

使用Nvidia Retinanet在自定义数据集上训练视网膜网络。每当我尝试运行训练命令时,我都会得到以下输出

输入命令:
root@5aff9c57da58:/workspace# odtk train odtk/data/retinanet_rn50fpn.pth --backbone ResNet50FPN
--images odtk/data/train2017-sample/data --annotations odtk/data/train2017-sample/train2017-sample。 json
--val-images odtk/data/val2017-sample/data --val-annotations odtk/data/val2017-sample/val2017-sample.json

输出:
注意!安装 ujson 可以加快注解的加载速度。
从retinanet_rn50fpn.pth 加载模型...
模型:RetinaNet
骨干网:ResNet50FPN
类:80,锚点:9
准备数据集...
加载器:pytorch
调整大小:[640, 1024],最大值:1333
设备:1 GPU
批次:2,精度: 混合
BBOX 类型:轴对齐
90000 次迭代的训练模型...
root@5aff9c57da58:/workspace#

什么也没有发生,训练脚本停止运行。还尝试了不同的参数,如类、迭代器等。

0 投票
0 回答
23 浏览

tensorflow-lite - 与 YOLOv4 相比,TF2 Model Zoo 的 RetinaNet 和 MobileNet 显示出极差的准确性和泛化能力

我很抱歉,但这个问题可能被极度低估(由于共享限制)。

我正在使用一个包含大约 2500 个图像和大约 3200 个注释的小型专有对象检测数据集。

我使用 Alex 的 Darknet 框架训练了一个 YOLOv4 模型,使用默认参数(更改了输入大小等要求),我看到了非常好的性能。一个高度自信的网络,可以很好地概括。我使用了yolov4.conv.137检查点并按照此处提到的步骤进行操作

在本教程以及Eager Mode Few Shot Detection教程中,我尝试使用 Tensorflow 2 的对象检测 API 执行相同的任务,并且主要使用默认训练参数。我从模型动物园尝试了不同版本的 MobilNet SSD 和 RetinaNet SSD 检查点。

我主要是为了测试这些模型与 Google 的 EdgeTPU 的兼容性。

我看到的主要问题是 TF2 对象检测 API 模型在将它们转换为 TFlite 后的可怕泛化能力。诸如嘈杂的盒子和仅看到奇异类预测之类的问题。就好像他们只接受了 1 或 2 张图像的训练。

  1. YOLOv4 框架可能会出现这种性能差异,是否有任何具体原因?
  2. 关于在微调这些模型以提高性能时可能会发生什么变化的任何建议?
  3. 你认为我应该关注 EfficientDet 类型的模型,因为它们在基准数据集上表现出更好的性能吗?

非常感谢您的帮助和见解!