title: Cannot import name 'ResNet50_Weights' from 'torchvision.models.resnet'
body: <p>I was previously loading a ResNet model with the ResNet50_Weights parameter successfully, but then suddenly I started getting the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;splitting_models.py&quot;, line 3, in &lt;module&gt;
      from torchvision.models.resnet import ResNet50_Weights
  ImportError: cannot import name 'ResNet50_Weights' from 'torchvision.models.resnet' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/torchvision/models/resnet.py)
  </code></pre>
  <p>Here is the import:</p>
  <pre><code>from torchvision.models import ResNet50_Weights
  </code></pre>
  <p>How could I go about fixing this?</p>
  <p>PyTorch version: 1.2.0</p>
  <p>TorchVision version: 0.4.0</p>
  <h2>EDIT</h2>
  <p>Upgrading using</p>
  <pre><code>pip install --upgrade torch torchvision
  </code></pre>
  <p>to the following versions fixed the issue:</p>
  <p>PyTorch version: 1.12.0</p>
  <p>TorchVision version: 0.13.0</p>