IsADirectoryError: [Errno 21] Is a directory:

i having this error when i am trying to train my model in pytorch

niter = 0
for epoch in range(num_epochs):
    for i,(images,labels) in enumerate(train_loader):
        images = images.cuda()
        labels =labels.cuda()
        outputs = model(images)
        optimizer.zero_grad()
        loss = criterion.forward(labels,outputs)
        loss.backward()
        optimizer.step()
        del images,labels,outputs
        if i%100 == 0:
            print('Epoch [%d/%d], Step [%d/%d], Loss = %.4f' %(epoch+1, num_epochs, i+1, len(train_dataset)//bs, loss.data))
            writer.add_scalar('Train/Loss', loss.data, niter)
            niter+=100

the result of the first epoch Epoch [1/1000], Step [1/10], Loss = 0.8768
and after that the error appears as
IsADirectoryError: [Errno 21] Is a directory: ‘data/training/images/.ipynb_checkpoints’

Blockquote

it seems something is wrong with your dataset. Simply remove the directory,rm -rf data/training/images/.ipynb_checkpoints. or add filter inside your dataset, or avoid using notebook in that directory.