将分类的类别也应用在训练程序中,更好的解耦。
This commit is contained in:
@@ -8,7 +8,7 @@ def main():
|
||||
|
||||
# 1. 加载训练好的基础模型权重
|
||||
base_model = create_food_cnn()
|
||||
model_path = "../model/09/best_food_model.pth"
|
||||
model_path = "../model/10/best_food_model.pth"
|
||||
|
||||
if not os.path.exists(model_path):
|
||||
print(f"错误:模型文件不存在 {model_path}")
|
||||
@@ -37,7 +37,7 @@ def main():
|
||||
traced_model = torch.jit.trace(mobile_model, example_input)
|
||||
|
||||
# 保存模型
|
||||
output_path = "../model/09/best_food_model_mobile.pt"
|
||||
output_path = "../model/10/best_food_model_mobile.pt"
|
||||
traced_model.save(output_path)
|
||||
print(f"✓ TorchScript模型保存成功: {output_path}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user