Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

train parameter should be explained before download, transform and target_transform parameter #8784

Open
hyperkai opened this issue Dec 6, 2024 · 1 comment

Comments

@hyperkai
Copy link

hyperkai commented Dec 6, 2024

📚 The doc issue

In the doc of QMNIST(), train parameter is located before **kwargs which are download, transform and target_transform parameter as shown below:

class torchvision.datasets.QMNIST(root: Union[str, Path], what: Optional[str] = None, compat: bool = True, train: bool = True, **kwargs: Any)

But train parameter is explained after download, transform and target_transform parameter as shown below:

Parameters:
...

  • compat (bool,optional) – A boolean that says whether the target for each example is class number (for compatibility with the MNIST dataloader) or a torch vector containing the full qmnist information. Default=True.
  • download (bool, optional) – If True, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
  • transform (callable, optional) – A function/transform that takes in a PIL image and returns a transformed version. E.g, transforms.RandomCrop
  • target_transform (callable, optional) – A function/transform that takes in the target and transforms it.
  • train (bool,optional,compatibility) – When argument ‘what’ is not specified, this boolean decides whether to load the training set or the testing set. Default: True.

Suggest a potential alternative/fix

So, train parameter should be explained before download, transform and target_transform parameter as shown below:

Parameters:
...

  • compat (bool,optional) – A boolean that says whether the target for each example is class number (for compatibility with the MNIST dataloader) or a torch vector containing the full qmnist information. Default=True.
  • train (bool,optional,compatibility) – When argument ‘what’ is not specified, this boolean decides whether to load the training set or the testing set. Default: True.
  • download (bool, optional) – If True, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
  • transform (callable, optional) – A function/transform that takes in a PIL image and returns a transformed version. E.g, transforms.RandomCrop
  • target_transform (callable, optional) – A function/transform that takes in the target and transforms it.
@NicolasHug
Copy link
Member

Thanks for the report @hyperkai , please feel free to submit a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants