'NoneType' object cannot be interpreted as an integer

I want to train linear classifier with RNN encoder and decoder
train_fn(model, dataloaders)
model = LinearClassifier(encoder=encoder, enc_type=‘rnn’, H=H, C=C)

but I’m getting error here while training:
pbar = tqdm(enumerate(train_dataloader),total=len(train_dataloader))

The error is:
TypeError: ‘NoneType’ object cannot be interpreted as an integer

Check the creation of the Dataset, sampler, and DataLoader as it seems as if the DataLoader got a None input as the dataset or sampler.

1 Like