Half precision training

Thanks for your reply
I would also like to know when I resume training algorithm like yolov3 with darknet backbone should I use model.load_weights(darknet weights) or use model.load_state_dict(checkpoint[‘model’]) and what this should do with this piece of code:

Freeze darknet53.conv.74 layers for first some epochs

if freeze_backbone:
    if epoch < 20:
        for i, (name, p) in enumerate(model.named_parameters()):
            if int(name.split('.')[1]) < 75:  # if layer < 75
                p.requires_grad = False
    elif epoch >= 20:
        for i, (name, p) in enumerate(model.named_parameters()):
            if int(name.split('.')[1]) < 75:  # if layer < 75
                p.requires_grad = True

Also when I wrote imgs = torch.tensor(imgs, requires_grad=True) it said its recommended to use imgs.clone().detach().requires_grad_(True) then I got:
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same