以下函数基本上返回numpy.ndarray
def getimage(id):
img = self.coco.loadImgs(id)
I = io.imread(img['coco_url'])
return I #returns 'numpy.ndarray'
从 main 调用 的getimage函数:
x = load.getimage(id).
x = torch.load(x)
抛出的错误:
'numpy.ndarray' object has no attribute 'seek'. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.