lots of change

This commit is contained in:
2026-08-11 09:36:38 +08:00
parent 17b5459ce1
commit 5199e3040f
13 changed files with 26 additions and 83 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ def test():
dataset_dir = os.path.join(core_dir, "dataset", mode, "test")
# 【修改3】加载ONNX模型,替代原来的PyTorch模型加载
session = ort.InferenceSession(os.path.join(model_dir, "resnet18_epoch_50_bak2.onnx"), providers=providers)
session = ort.InferenceSession(os.path.join(model_dir, "resnet_epoch_100.onnx"), providers=providers)
# 获取输入名称(用于后续推理时指定输入)
input_name = session.get_inputs()[0].name
+1 -1
View File
@@ -21,7 +21,7 @@ def test():
print("model_dir", model_dir)
net = resnet()
net.load_state_dict(torch.load(os.path.join(model_dir, "resnet_epoch_50.pth"), weights_only=True))
net.load_state_dict(torch.load(os.path.join(model_dir, "resnet_epoch_99.pth"), weights_only=True))
print("111")