Open vmirly opened 1 year ago
The test dataset is a DataPipe, and therefore does not have a length, which results in the following error in the evaluate function:
return total_acc/len(dataloader.dataset), total_loss/len(dataloader.dataset) TypeError: MapperIterDataPipe instance doesn't have valid length
One way to fix this is to convert that to a list, before applying the len() function:
len()
return total_acc/len(list(dataloader.dataset)), total_loss/len(list(dataloader.dataset))
The test dataset is a DataPipe, and therefore does not have a length, which results in the following error in the evaluate function:
One way to fix this is to convert that to a list, before applying the
len()
function: