Skip to content

[BUG] - <title> TypeError when using len(train_dataloader.dataset) in Quickstart PyTorch tutorial #3226

Open
@hoangziet

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

Metadata

Assignees

No one assigned

    Labels

    bugcoreTutorials of any level of difficulty related to the core pytorch functionalityintro

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions