print("\033[0;33;45m·" + '|| test_max_acc :' + str(max_acc_test) + ' iter:' + str(max_acc_test_iter) + "\033[0m") print("\033[0;33;44m·" + '|| veri_max_AUC :' + str(max_auc_verify) + ' iter:' + str(max_auc_verify_iter) + "\033[0m") print("\033[0;33;44m·" + '|| test_max_AUC :' + str(max_auc_test) + ' iter:' + str(max_auc_test_iter) + "\033[0m") print("\033[0;33;40m·" + '|| veri_max_sen :' + str(max_sen_verify) + ' iter:' + str(max_sen_verify_iter) + "\033[0m") print("\033[0;33;40m·" + '|| test_max_sen :' + str(max_sen_test) + ' iter:' + str(max_sen_test_iter) + "\033[0m") print("\033[0;33;42m·" + '|| veri_max_spc :' + str(max_spc_verify) + ' iter:' + str(max_spc_verify_iter) + "\033[0m") print("\033[0;33;42m·" + '|| test_max_spc :' + str(max_spc_test) + ' iter:' + str(max_spc_test_iter) + "\033[0m") # save loss on train set (will save loss both on vre&test set in future) txt_s1.write(str(cost[0]) + '\n') # verify & test : only save result , no model will be saved (only use fuc 'test_on_model'or'test_on_model4_subject') if Iter >= min_verify_Iters and Iter % verify_Iters_step == 0: # func 4 verify every 'verify_Iters_step reached' time # vre_result = test_on_model(model=d_model, test_list=H5_List_verify, iters=Iter, save_path=Result_save_Path, data_input_shape=data_input_shape,front_name = 'vre') vre_result = test_on_model4_subject(model=d_model, test_list=H5_List_verify, iters=Iter, save_path=Result_save_Path, data_input_shape=data_input_shape, front_name='vre', file_sep=file_sep) # save ver_result txt_s2.write(str(Iter) + '@' + str(vre_result) + '\n') txt_s4.write(str(Iter) + '@' + str(vre_result[0]) + '\n') txt_s5.write(str(Iter) + '@' + str(vre_result[3]) + '\n') # func 4 test every 'verify_Iters_step reached' time # test_result_perfile = test_on_model(model=d_model, test_list=H5_List_test, iters=Iter, save_path=Result_save_Path, data_input_shape=data_input_shape, front_name='test_perfile') test_result = test_on_model4_subject(model=d_model, test_list=H5_List_test, iters=Iter, save_path=Result_save_Path, data_input_shape=data_input_shape, front_name='test', file_sep=file_sep) txt_s3.write(str(Iter) + '@' + str(test_result) + '\n') txt_s6.write(str(Iter) + '@' + str(test_result[0]) + '\n') txt_s7.write(str(Iter) + '@' + str(test_result[3]) + '\n') if vre_result[0] >= max_acc_verify:
data_input_shape = [280, 280, 16] label_index = 'label3' #label3 label_shape = [2] os_stage = "L" # W:windows or L:linux #====================================================================================================================== if os_stage == "W": file_sep = r"\\" elif os_stage == "L": file_sep = r'/' else: file_sep = r'/' # d_model = resnet_or(use_bias_flag=True, classes=2) d_model.compile(optimizer=adam(lr=2e-6), loss=EuiLoss, metrics=[y_t, y_pre, Acc]) d_model.load_weights( filepath= '/data/XS_Aug_model_result/model_templete/recurrent/pnens_zhuanyi_resnet_v_new(fuxk)/fold5/m_60000_model.h5', by_name=True) test_result = test_on_model4_subject(model=d_model, test_list=H5_List, iters=0, save_path=Result_save_Path, data_input_shape=data_input_shape, label_shape=label_shape, front_name='test', file_sep=file_sep, label_index=label_index)