美文网首页
python 遇到的问题总结

python 遇到的问题总结

作者: HD1992 | 来源:发表于2019-04-03 16:45 被阅读0次

    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.
    这个原因是因为程序中操作的numpy中有使用负索引的情况:image[…, ::-1]。

    解决办法比较简单,加入image这个numpy变量引发了错误,返回image.copy()即可。因为copy操作可以在原先的numpy变量中创造一个新的不适用负索引的numpy变量。


    image.png

    相关文章

      网友评论

          本文标题:python 遇到的问题总结

          本文链接:https://www.haomeiwen.com/subject/xfbzbqtx.html