ValueError: some of the strides of a given numpy array are negative. This is currently not supported

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))

你可能感兴趣的:(PyTorch,Python,深度学习,深度学习三维重建)