我在跑以下代碼時出現錯誤
pic = pic[:,:, ::-1,:]
pic = torch.from_numpy(pic.transpose([3,0,1,2]))
## ValueError: some of the strides of a given numpy array are negative
解決方案
pic = pic[:,:, ::-1,:].copy() #加上.copy()
具體可參考:discuss.pytorch
我在跑以下代碼時出現錯誤
pic = pic[:,:, ::-1,:]
pic = torch.from_numpy(pic.transpose([3,0,1,2]))
## ValueError: some of the strides of a given numpy array are negative
解決方案
pic = pic[:,:, ::-1,:].copy() #加上.copy()
具體可參考:discuss.pytorch
繼續運行 ?* 回憶上次內容 上次使用shell環境中的命令 命令 作用 c