This is my code:
model=smp.Unet('efficientnet-b3',encoder_weights=None,classes=4)
# # #
for m in model.modules():
    weights_init_kaiming(m)
# checkpoint=torch.load(checkpoint_path)
# model.load_state_dict(checkpoint['state'])
device=torch.device('cuda:0')
model.to(device)

total_steps=len(train_dl)
optimizer=torch.optim.AdamW(model.parameters(),lr=0.05,weight_decay=0.01)
scheduler=torch.optim.lr_scheduler.OneCycleLR(optimizer,max_lr=0.0005,total_steps=total_steps,epochs=30)


It was very embarrassing that I could not debug with CPU because of the machine, but if I used GPU to debug, the error result did not change