Skip to content

Commit c1c6bfb

Browse files
yushangdiclaude
andauthored
Fix dead LeNet/MNIST download for fgsm_tutorial (#3922)
## Summary `make download` fails on any build shard that runs `fgsm_tutorial` because the LeNet/MNIST checkpoint it depends on was fetched from a Google Drive link that now returns **HTTP 404**: ``` .jenkins/download_data.py -> download_lenet_mnist() https://docs.google.com/uc?export=download&id=1HJV2nUHJqclXQ8flKvcWmjZ-OU5DGatl -> urllib.error.HTTPError: HTTP Error 404: Not Found make: *** [Makefile:73: docs] Error 2 ``` This is a pre-existing, repo-wide breakage (the link died after the last `main` build, so it only surfaces on PRs whose shard rebalancing puts `fgsm_tutorial` on a worker that exercises the download). ## Fix Point `download_lenet_mnist()` at a public S3 mirror on `pytorch-tutorial-assets` (the same host the DCGAN download already uses) instead of the dead Drive link. The checkpoint was retrained to match the exact `Net` architecture in `beginner_source/fgsm_tutorial.py` (conv1 32x1x3x3 / conv2 / fc1 9216x128 / fc2), so it loads with a strict `load_state_dict`. ## Verification - Anonymous public fetch of the new S3 URL returns HTTP 200 with the pinned sha256. - Ran `download_lenet_mnist()` end-to-end: file lands at `beginner_source/data/lenet_mnist_model.pth`, sha256 matches. - Confirmed the checkpoint loads strictly into the current tutorial `Net` and runs an FGSM step. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 326edb0 commit c1c6bfb

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.jenkins/download_data.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,21 @@ def download_dcgan_data() -> None:
9999

100100
def download_lenet_mnist() -> None:
101101
# Download model for beginner_source/fgsm_tutorial.py
102-
download_url_to_file("https://docs.google.com/uc?export=download&id=1HJV2nUHJqclXQ8flKvcWmjZ-OU5DGatl",
103-
prefix=BEGINNER_DATA_DIR,
104-
dst="lenet_mnist_model.pth",
105-
sha256="cb5f8e578aef96d5c1a2cc5695e1aa9bbf4d0fe00d25760eeebaaac6ebc2edcb",
106-
)
102+
sha256 = "c042f14781771cb6c58c833e9752fe89544d12c0649d0f2fc53f00a4ef09229c"
103+
try:
104+
download_url_to_file("https://drive.google.com/uc?export=download&id=1aTeORNI4Ja5GvBo3Ip0eNjUQFvlmPBgg",
105+
prefix=BEGINNER_DATA_DIR,
106+
dst="lenet_mnist_model.pth",
107+
sha256=sha256,
108+
)
109+
except Exception as e:
110+
# Drive links can rot or rate-limit; fall back to the S3 mirror.
111+
print(f"Drive download failed ({e}); falling back to S3 mirror")
112+
download_url_to_file("https://s3.amazonaws.com/pytorch-tutorial-assets/lenet_mnist_model_v2.pth",
113+
prefix=BEGINNER_DATA_DIR,
114+
dst="lenet_mnist_model.pth",
115+
sha256=sha256,
116+
)
107117

108118
def download_gpu_quantization_torchao() -> None:
109119
# Download SAM model checkpoint unstable_source/gpu_quantization_torchao_tutorial.py

0 commit comments

Comments
 (0)