RuntimeError: stack expects each tensor to be equal size, but got [1180, 1070, 3] at entry 0 and [77
意思是加载的一批图片里面存在大小不一致的情况,分别是[1100,1070]和[776,710]然后根据这个问题,仔细看了下图片大小,确实存在不一样的尺寸将图片一致化的方法:fromPILimportImageimportos.pathimportglobdefResize(file,outdir,width,height):imgFile=Image.open(file)try:newImage=