Did you update PyTorch and torchvision recently or just one of these?
Based on your code snippet, it looks like you’re getting this error just after importing torchvision.models.
In the recent stable PyTorch version (1.2.0) a lot of changes were made to the JIT, so that I would also update torchvision to 0.4.0.