Repository: pytorch/vision

Issue:
Re-upload weights for old model with new serialization
Some of the oldest models we have (including resnets) have been serialized with a legacy format which, while is mostly compatible with the current code, has some corner cases that do not work as expected anymore, see https://github.com/pytorch/pytorch/issues/31615 (basically, if the data is in a `BytesIO` object it doesn't work).

Here is a snippet to reproduce the problem:

```python
import urllib.request
import io

url = 'https://download.pytorch.org/models/resnet50-19c8e357.pth'
path = './tmp.pth'
urllib.request.urlretrieve(url, path)

with open(path, "rb") as fd:
    buf = io.BytesIO(fd.read())
    
state_dict = torch.load(buf, "cpu")
```

This fails. We should re-save those weights and re-upload them (while keeping the old files around for BC) and update the paths in the model files to use the new files. This code re-downloads the old files and re-serializes it with the new format

```python
import urllib.request
import io

url = 'https://download.pytorch.org/models/resnet18-5c106cde.pth'
path = './tmp.pth'
urllib.request.urlretrieve(url, path)

torch.save(torch.load(path), path)

with open(path, "rb") as fd:
    buf = io.BytesIO(fd.read())

state_dict = torch.load(buf, "cpu")
```

One thing to keep in mind is if changing the default weights files (while being equivalent to the old models) won't bring unexpected changes / issues to some users, as it will trigger a re-download of the file, which might fail because of many reasons (the server doesn't have access to internet, files have been manually downloaded, etc).


Discussion:
For ref, the following classifications model urls raise an `UnpicklingError`:

- [ ] resnet34-333f7ec4.pth
- [ ] alexnet-owt-4df8aa71.pth
- [ ] squeezenet1_0-a815701f.pth
- [ ] resnet152-b121ed2d.pth
- [ ] squeezenet1_1-f364aa15.pth
- [ ] resnet50-19c8e357.pth
- [ ] resnet101-5d3b4d8f.pth
- [ ] resnet18-5c106cde.pth

Resolving patch:
diff --git a/torchvision/models/alexnet.py b/torchvision/models/alexnet.py
--- a/torchvision/models/alexnet.py
+++ b/torchvision/models/alexnet.py
@@ -8,7 +8,7 @@
 
 
 model_urls = {
-    'alexnet': 'https://download.pytorch.org/models/alexnet-owt-4df8aa71.pth',
+    'alexnet': 'https://download.pytorch.org/models/alexnet-owt-7be5be79.pth',
 }
 
 
diff --git a/torchvision/models/resnet.py b/torchvision/models/resnet.py
--- a/torchvision/models/resnet.py
+++ b/torchvision/models/resnet.py
@@ -11,11 +11,11 @@
 
 
 model_urls = {
-    'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
-    'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
-    'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',
-    'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth',
-    'resnet152': 'https://download.pytorch.org/models/resnet152-b121ed2d.pth',
+    'resnet18': 'https://download.pytorch.org/models/resnet18-f37072fd.pth',
+    'resnet34': 'https://download.pytorch.org/models/resnet34-b627a593.pth',
+    'resnet50': 'https://download.pytorch.org/models/resnet50-0676ba61.pth',
+    'resnet101': 'https://download.pytorch.org/models/resnet101-63fe2227.pth',
+    'resnet152': 'https://download.pytorch.org/models/resnet152-394f9c45.pth',
     'resnext50_32x4d': 'https://download.pytorch.org/models/resnext50_32x4d-7cdf4587.pth',
     'resnext101_32x8d': 'https://download.pytorch.org/models/resnext101_32x8d-8ba56ff5.pth',
     'wide_resnet50_2': 'https://download.pytorch.org/models/wide_resnet50_2-95faca4d.pth',


Test patch: