英文:
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
假设您想从已经训练好的模型中移除额外的标签,通常情况下不太可能从已训练好的模型中移除标签。因为模型已经根据所有类别提供最佳预测来更新其权重,这将需要改变模型的基本结构以及模型权重本身。
一般来说,您有三个不同的选择:
-
使用仅包含您需要进行预测的标签(或您所提到的对象名称)的数据集重新训练模型。
-
寻找已经使用仅包含您想要的类别/标签的数据集进行训练的不同模型。
-
对当前模型的输出进行过滤。您可以应用一个过滤器(也许是后处理步骤),可以删除您不需要的标签的预测。
考虑到您的情况,如果您正在寻找一个快速解决方案,并且已经准备好一个数据集以及计算资源来训练一个新模型,我认为最后一个选项会更适合您。
英文:
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:
-
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.
-
Look for a different model that has been trained with a dataset that only has the classes/labels that you want.
-
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论