Ok, I was having this error, too. My network is very close to the one at https://github.com/michhar/pytorch-yolo-v3-custom 17. The main difference between my network and the one in that GitHub repo is my use of the Adedelta optimizer rather than SGD.
Anyway, if you’re “freezing” any part of your network, and your optimizer is only passed “unfrozen” model parameters (i.e. your optimizer filters out model parameters whose requires_grad is False), then when resuming, you’ll need to unfreeze the network again and re-instantiate the optimizer afterwards. See the following code, which loads from a checkpoint:
def load_checkpoint(checkpoint_fpath, model, optimizer):
    # Load the state dicts from file
    checkpoint = torch.load(checkpoint_fpath)
    # Load for model
    model.load_state_dict(checkpoint['state_dict'])

    # Unfreeze model & have to re-instantiate optimizer
    unfreeze_layers(model, stop_layer)
    optimizer = optim.Adadelta(filter(lambda p: p.requires_grad, model.parameters()), lr=1.0, rho=0.95, eps=1e-08)

    # Load for optimizer
    optimizer.load_state_dict(checkpoint['optimizer'])

    return model, optimizer

And to save:
checkpoint = {
    'state_dict': model.state_dict(),
    'optimizer': optimizer.state_dict()
}
torch.save(checkpoint, "savefilepath.pth")

And you can include epoch in this checkpoint dictionary very easily, by just adding another entry such as 'epoch': currentEpoch. This can be then be used in load_checkpoint(), but you’ll have to modify the function yourself.
TL;DR: Whatever freezing/unfreezing operation you performed last before saving has to be done again before instantiating the optimizer.
It seems obvious now (as the optimizer very evidently filters out frozen parameters), but it took me much longer than I care to admit to figure it out… Hope this helps someone!