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)
        loss = criterion.forward(labels,outputs)
        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,
            writer.add_scalar('Train/Loss',, niter)

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’


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.