https://oldpan.me/archives/pytorch-conmon-problem-in-training
上邊是參考鏈接,mark
1 RuntimeError: some of the strides of a given numpy array are negative. This is currently not supported, but will be added in future releases.
這個(gè)原因是因?yàn)槌绦蛑胁僮鞯膎umpy中有使用負(fù)索引的情況:image[…, ::-1]。
解決辦法比較簡單,加入image這個(gè)numpy變量引發(fā)了錯(cuò)誤,返回image.copy()即可。因?yàn)閏opy操作可以在原先的numpy變量中創(chuàng)造一個(gè)新的不適用負(fù)索引的numpy變量。

image.png