Improve logging in datasets?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 7.3k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 13
Description
Status Quo
Currently our datasets sometimes print diagnostic messages:
The common download utilities write to STDOUT
and use tqdm which writes to STDERR:
The latter has the option to also write to a different stream, but our fallback from torch.hub does not.
In some cases some information is also logged by our dependencies
In any case, the user has no control over it whatsoever.
Proposal
Have a global or local setting for the stream we write to. For example
torchvision.datasets.logging_stream()
I would default it to sys.stdout, but no strong opinion. To silence everything, one could do
import os
torchvision.datasets.logging_stream(open(os.devnull, "w"))
We could also add a shortcut with quiet=True for that.
Priority
This thing was touched on in https://github.com/pytorch/vision/issues/330#issuecomment-854715846 and from time to time we receive issues (#330) to either silence the output or redirect it to a different stream (#7040).
Still, I think the priority is pretty low for this. I just wanted to have it in a separate issue to make it easier to track.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading torchvision/datasets/caltech.py and torchvision/datasets/utils.py, especially the diagnostic output and tqdm usage linked in the issue. Compare the torch.hub download fallback and the pycocotools logging path. Done means dataset-related output has a documented, user-controllable stream or quiet behavior across these paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100