解决python调用TensorFlow时出现FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecate

浅浅的花香味﹌ 2023-10-07 09:50 139阅读 0赞

最近因为要做一个基于深度学习的人脸识别项目,要用到TensorFlow,但是下载完成后后发现import tensorflow总是出现FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’._np_quint8 = np.dtype([(“quint8”, np.uint8, 1)])的错误,如图

百度了许多,很多说是numpy的版本不对,换了numpy的版本就行了,但是我换了好几个版本都没用,仍然报错,最后发现,可以在pycharm中使用Import tensorflow,然后将点进出现的警告,进入dtype.py,修改对应行的代码,把np.dtype([(“quint8”, np.uint8, 1)])修改为np.dtype([(“quint8”, np.uint8, (1,))])就完美解决了,如图

修改为

————————————————
版权声明:本文为CSDN博主「涵小呆」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/BigDream123/article/details/99467316

发表评论

表情:
评论列表 (有 0 条评论,139人围观)

还没有评论,来说两句吧...

相关阅读