如何从以.pb格式保存的训练模型中移除一个对象?

huangapple go评论77阅读模式
英文:

How to remove an object from the trained model in .pb format?

问题

我正在训练Tello无人机来检测汽车,所以我在这里使用这段代码:https://github.com/Shreyas-dotcom/Tello_Obj_Recognition,但是代码中包含其他物体的名称,如自行车。所以我的问题是:如何从训练模型中删除其他物体。

英文:

Iam training tello drone to detecting the cars, so I use this code here: https://github.com/Shreyas-dotcom/Tello_Obj_Recognition, but the code contain others objects names such as bike. So my question is: How can I remove others objects from the trained model.

答案1

得分: 0

假设您想从已经训练好的模型中移除额外的标签,通常情况下不太可能从已训练好的模型中移除标签。因为模型已经根据所有类别提供最佳预测来更新其权重,这将需要改变模型的基本结构以及模型权重本身。

一般来说,您有三个不同的选择:

  1. 使用仅包含您需要进行预测的标签(或您所提到的对象名称)的数据集重新训练模型。

  2. 寻找已经使用仅包含您想要的类别/标签的数据集进行训练的不同模型。

  3. 对当前模型的输出进行过滤。您可以应用一个过滤器(也许是后处理步骤),可以删除您不需要的标签的预测。

考虑到您的情况,如果您正在寻找一个快速解决方案,并且已经准备好一个数据集以及计算资源来训练一个新模型,我认为最后一个选项会更适合您。

英文:

Assuming you want to remove additional labels from a trained model, It is generally not possible to remove labels from a trained model. Since the model has updated its weights to provide the best predictions in all classes, it would require changing the underlying structure of the model and the model weights themselves.

Generally, you have three different options:

  1. Retrain the model with using a dataset that only contains labels (or object names as you've referred to it) that you need to take predictions.

  2. Look for a different model that has been trained with a dataset that only has the classes/labels that you want.

  3. Filter the outputs from the current model. You can apply a filter (maybe a postprocessing step) that can remove predictions regarding labels that you don't need.

Given your situation, it is my opinion that the last option will suit you better if you are looking for a quick fix and if you have a dataset ready and computing resources to train a new model, you can go for the first option.

huangapple
  • 本文由 发表于 2023年1月8日 23:08:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/75048851.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定