import torch
bla bla bla
mels_self = torch.utils.checkpoint.checkpoint(self.decoder_self_run, mels, encoder_outputs, batch['text_lengths'], batch['mel_lengths'])
Which PyTorch version are you using (you can check it via print(torch.__version__)). torch.utils.checkpoint was introduced some time ago, so I’ wondering if you are working with a really old PyTorch build. If so, could you update to the latest stable release (1.7.0) and retry your code?
I’m not completely sure how the import mechanism works in different Python versions and my understanding is that newer Python versions are more “flexible”. You could thus try it with e.g. Python3.8 and if it’s still not working would need to import the method directly (unsure if it’s a PyTorch limitation or the desired workflow in Python).