detectron2保存模型由pth转pt
detectron2保存模型由pth转pt checkpoint源代码: https://detectron2.readthedocs.io/en/latest/_modules/fvcore/common/checkpoint.html#Checkpointer
重写from fvcore.common.checkpoint import Checkpointer中的Checkpointer类中的save方法
class MYCheckpointer(Checkpointer):
def save(self, name, **kwargs):
if not self.save_dir or not self.save_to_disk:
return
data = {}
data["model"] = self.model.state_dict()
共有 0 条评论