-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[Docs] Doctest flake in working-with-images.rst caused by PyTorch model download message #62283
Copy link
Copy link
Open
Labels
community-backlogdataRay Data-related issuesRay Data-related issuesdocsAn issue or change related to documentationAn issue or change related to documentation
Description
What's happening
The doctest in doc/source/data/working-with-images.rst flakes in CI because an extra PyTorch download message gets printed to stdout when running the image inference example.
Why it happens
When ImageClassifier runs models.resnet18(weights=weights) for the first time, PyTorch downloads the model weights and prints:
Downloading: "https://download.pytorch.org/models/resnet18-f37072fd.pth" to /root/.cache/torch/hub/checkpoints/resnet18-f37072fd.pth
CI containers start fresh with no cache, so this message almost always appears there. The doctest then fails because it gets an extra line that wasn't in the expected output.
Fix
Add :options: +SKIP to the .. testoutput:: block so the output is not checked. The code still runs and the expected output stays visible in the docs for readers.
.. testoutput::
:options: +SKIP
{'class': 118}
{'class': 153}
{'class': 296}cc @bveeramani
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
community-backlogdataRay Data-related issuesRay Data-related issuesdocsAn issue or change related to documentationAn issue or change related to documentation
Type
Projects
Status
In progress