I am using DataLoader with ImageFolder, and logging set level to be logging.DEBUG.
train_dataset = datasets.ImageFolder(args.dataset, transform)
train_loader = DataLoader(train_dataset, batch_size=args.batch_size)
logging.basicConfig(filename=args.checkpoint_dir + ‘/log’, level=logging.DEBUG)
My training loop runs like this:
for batch_id, (x, _) in enumerate(train_loader):
both batch_id and x are evaluated during the loop.
However I am getting:
DEBUG: PIL.Image:Error closing: ‘NoneType’ object has no attribute 'close’
inside the log file, though the training process and resulting models are just working fine.
Does anyone know how can I get rid of these warnings?