Open BarryRun opened 1 year ago
Describe the bug(问题描述) 根据这里 的代码,在verbose>0时,需要计算当前batch上的metric。而在特殊情况下,例如最后一个batch刚好只有几条label为0的数据时,会出现以下报错:
ValueError: y_true contains only one label (0.0). Please provide the true labels explicitly through the labels argument.
是否可以在trainer中添加让dataloader分布均匀的代码?
可以在basemodel.py的第268行加try,如果lable全为0就跳过
Describe the bug(问题描述) 根据这里 的代码,在verbose>0时,需要计算当前batch上的metric。而在特殊情况下,例如最后一个batch刚好只有几条label为0的数据时,会出现以下报错:
是否可以在trainer中添加让dataloader分布均匀的代码?