Attribute Error: 'int' object has no attribute 'item'
franksyng opened this issue · 0 comments
franksyng commented
When I run the network in Kinetics dataset format, an error is encountered in validation.py, which raised from pytorch that a INT doesnt have attribute item(). According to the documentation of pytorch, only a tensor can use 'Tensor.item()'. However, in the case of validation.py, the variable 'losses' is a type of AverageMeter() and 'losses.avg' is a type of INT, both of them have no attribute item(). Sincerely hope you can help us out of this. Thanks.
Below is the part of the codes that raising the error:
logger.log({'epoch': epoch, 'loss': losses.avg.item(), 'prec1': top1.avg.item(), 'prec5': top5.avg.item()})