You can check pytorch densenet 20 for the solution. The internal state_dict have changed from something like features.denseblock1.denselayer1.norm.1.weight to features.denseblock1.denselayer1.norm1.weight
Also, you can write a simple function that load the model, modify state_dict and save the model.
def modify_state_dict(state_dict):
    pattern = re.compile(
                r'^(.*denselayer\d+\.(?:norm|relu|conv))\.((?:[12])\.(?:weight|bias|running_mean|running_var))$')
    state_dict = checkpoint['state_dict']
    for key in list(state_dict.keys()):
        res = pattern.match(key)
        if res:
            new_key = res.group(1) + res.group(2)
            state_dict[new_key] = state_dict[key]
            del state_dict[key]

checkpoint = torch.load(model_path)
modify_state_dict(checkpoint['state_dict'])
torch.save(checkpoint, model_path)

For the num_batches_tracked, pytorch has added in later version. I have checked the value of these key in densenet layer and they are all tensor(0, device='cuda:0'). I think you can add that missing key to the state_dict when modifying it. Btw, I load my trained densenet model on v0.4.1 without that num_batches_tracked key.