ValueError: some of the strides of a given numpy array are negative. This is currently not supported, but will be added in future releases.
Pytorch0.4
问题:
ValueError: some of the strides of a given numpy array are negative. This is currently not supported, but will be added in future releases.
pfmS, scaleLS = rp.readPFM('/data/SceneFlow/driving_disparity/15mm_focallength/scene_backwards/slow/left/0001.pfm')
disp_LS = Variable(torch.FloatTensor(pfmS))
解决办法:
pfmS, scaleLS = rp.readPFM('/data/SceneFlow/driving_disparity/15mm_focallength/scene_backwards/slow/left/0001.pfm')
pfmS = np.ascontiguousarray(pfmS,dtype=np.float32)
disp_LS = Variable(torch.FloatTensor(pfmS))