[BUG] - <title> TypeError when using len(train_dataloader.dataset) in Quickstart PyTorch tutorial
Open
Nobody has claimed this yet.
bug
core
intro
- Dominant language
- Python
- Stars
- 9.3k
- Forks
- 4.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 4
Description
Add Link
https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html
Describe the bug
When using len(train_dataloader.dataset) to get the dataset size in the Google Colab notebook from Quickstart PyTorch, I encountered the following error:
TypeError: 'FashionMNIST' object is not callable
I think we can use another way to take the size we need:
train_dataloader.dataset.data.shape[0]
```
### Describe your environment
Google Colab
Torch version: 2.5.1+cu121
cc @subramen @albanD @jbschlosser
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 with the Quickstart PyTorch tutorial and its linked Google Colab notebook, then locate the use of len(train_dataloader.dataset) that produces the FashionMNIST TypeError. Verify the corrected dataset-size expression in Colab and confirm the tutorial runs without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation, machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100