# dataset hyper-parameter
dataset_name = '../data/LEVIR_T/LEVIR'
# training hyper-parameter
epochs: int = 250 # Number of epochs
batch_size: int = 32 # Batch size
inference_ratio = 2 # batch_size in val and test equal to batch_size*inference_ratio
learning_rate: float = 1e-3 # Learning rate
factor = 0.1 # learning rate decreasing factor
patience = 12 # schedular patience
warm_up_step = 500 # warm up step
weight_decay: float = 1e-3 # AdamW optimizer weight decay
amp: bool = True # if use mixed precision or not
load: str = "/data2/RSCD/data/LEVIR_T/LEVIR_best_f1score_model/best_f1_epoch100.pth" # Load model and/or optimizer from a .pth file for testing or continuing training
max_norm: float = 20 # gradient clip max norm
# evaluate hyper-parameter
evaluate_epoch: int = 30 # start evaluate after training for evaluate epochs
stage_epoch = [0, 0, 0, 0, 0] # adjust learning rate after every stage epoch
save_checkpoint: bool = True # if save checkpoint of model or not
save_interval: int = 10 # save checkpoint every interval epoch
save_best_model: bool = True # if save best model or not
# log wandb hyper-parameter
log_wandb_project: str = 'dpcd-1' # wandb project name
# data transform hyper-parameter
noise_p: float = 0.3 # probability of adding noise
# model hyper-parameter
dropout_p: float = 0.1 # probability of dropout
patch_size: int = 256 # size of input image
y = 2 # ECA-net parameter
b = 1 # ECA-net parameter
# inference parameter
log_path = './log_feature/'
您好,我使用LEVIR-CD中test数据集进行inference时出现了如下错误:
上面显示问题出在dpcd_parts.py中的F.interpolate,我感觉可能是参数scale_factor=ph.patch_size // h的问题,然后把ph.patch_size // h打印出来发现是0,之后我把scale_factor设置为了2或者0.5,也不行,我又把ph.patch_size设置为了1024(LEVIR-CD数据集是1024x1024),还是出现了一些错误。
最后我把下面这句代码中的log=True改为了log=False,inference.py就正常运行了,不过没有得到预测图,只得到了F1等各种指标,但是我想得到预测图,请问如何修改上述错误呢?
cd_preds = net(batch_img1, batch_img2, log=True, img_name=name)
这是我的参数设置: