Thanks for helping me.
I don’t understand why, but it keeps giving me the same error.
Traceback (most recent call last):
  File "trainer.py", line 584, in <module>
    main()
  File "trainer.py", line 368, in main
    loss_per_epoch, top1_train_ac = train(train_loader, model, criterion, optimizer, epoch)
  File "trainer.py", line 445, in train
    loss.backward()
  File "/usr/local/lib/python3.6/dist-packages/torch/tensor.py", line 198, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/usr/local/lib/python3.6/dist-packages/torch/autograd/__init__.py", line 100, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

I have added the new layer as you told me
    model = torch.nn.DataParallel(resnet.__dict__[args.arch]())

    checkpoint_path = "/content/drive/My Drive/CIFAR10_pruebas/pytorch_resnet_cifar10/save_resnet32/checkpoint3_1.th"

    # optionally resume from a checkpoint
    if checkpoint_path:
        if os.path.isfile(checkpoint_path):
            print("=> loading checkpoint '{}'".format(checkpoint_path))
            checkpoint = torch.load(checkpoint_path)
            model.load_state_dict(checkpoint['state_dict'])
            print("=> loaded checkpoint")
        else:
            print("=> no checkpoint found at '{}'".format(args.resume))

    #Freeze layers
    for param in model.parameters():
        param.requires_grad = False
    
    #Create you own layers to attach
    model.module.fc = nn.Linear(64,10)

    model.cuda()

Thanks!