修改配置和路径。

This commit is contained in:
2025-10-23 11:08:46 +08:00
parent 5db96600fe
commit 1c8ceef5b0
5 changed files with 29 additions and 21 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ def main():
# base_model = create_resnet50_embedding(embedding_dim=512, pretrained=True)
base_model = create_mobile_resnet50_embedding(embedding_dim=512, pretrained=True)
# model_path = "../model/embedding_20250930_102826/best_embedding_model.pth"
model_path = "../model/embedding_20251011_133653/best_embedding_model.pth"
model_path = "../model/WholeIngredientRecognition/embedding_20251021_085915/best_embedding_model.pth"
if not os.path.exists(model_path):
print(f"错误:模型文件不存在 {model_path}")
@@ -86,7 +86,7 @@ def main():
traced_model = torch.jit.trace(mobile_wrapper, single_input)
# 保存模型
output_path = "../model/embedding_20251011_133653/best_embedding_model_mobile.pt"
output_path = "../model/WholeIngredientRecognition/embedding_20251021_085915/best_embedding_model_mobile.pt"
traced_model.save(output_path)
print(f"✓ TorchScript模型保存成功: {output_path}")