作者,你好!我在运行推理函数step3_TestOrInference.py时,将fold_flag设为False后模型预测结果直接输出为0。但是当我将flod_flag设为True时,模型可以输出结果。会有预测结果图像生成。

下面是我更改的代码部分:
img_path = r'tn3k_dian2\tn3k_point\test-image'
mask_path = r'tn3k_dian2\tn3k_point\test-mask'
csv_file = r'tn3k_dian2\output.csv'
save_path = r'inference'
# 是否使用设定好的分折信息
fold_flag =False # 预测测试集则设置为False直接读取img_path中PNG文件进行测试,True则使用分折信息
使用的模型权重文件也存在:
weight_c1=r'result\TNSCUI\dpv3plus_stage1_5_1\models\epoch400_Testdice0.0000.pkl'
weight_c2=r'result\TNSCUI\dpv3plus_stage2_5_1\models\epoch400_Testdice0.0000.pkl'
请问问题出在哪里?
作者,你好!我在运行推理函数step3_TestOrInference.py时,将fold_flag设为False后模型预测结果直接输出为0。但是当我将flod_flag设为True时,模型可以输出结果。会有预测结果图像生成。

下面是我更改的代码部分:
img_path = r'tn3k_dian2\tn3k_point\test-image'
mask_path = r'tn3k_dian2\tn3k_point\test-mask'
csv_file = r'tn3k_dian2\output.csv'
save_path = r'inference'
使用的模型权重文件也存在:
weight_c1=r'result\TNSCUI\dpv3plus_stage1_5_1\models\epoch400_Testdice0.0000.pkl'
weight_c2=r'result\TNSCUI\dpv3plus_stage2_5_1\models\epoch400_Testdice0.0000.pkl'
请问问题出在哪里?