首页 > 编程语言 > 详细

Python运行tensortflow出现FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated;

时间:2020-03-29 12:07:43      阅读:619      评论:0      收藏:0      [点我收藏+]

出错情况:

技术分享图片

 

 可以看出是dtypes的文件中出现问题:

问题的位置:

_np_qint8 = np.dtype([("qint8", np.int8, 1)])
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
_np_qint32 = np.dtype([("qint32", np.int32, 1)])

# _np_bfloat16 is defined by a module import.

# Custom struct dtype for directly-fed ResourceHandles of supported type(s).
np_resource = np.dtype([("resource", np.ubyte, 1)])

修改方法,将里面的1改为(1,)

如:

_np_qint8 = np.dtype([("qint8", np.int8, (1,))])
_np_quint8 = np.dtype([("quint8", np.uint8, (1,))])
_np_qint16 = np.dtype([("qint16", np.int16, (1,))])
_np_quint16 = np.dtype([("quint16", np.uint16, (1,))])
_np_qint32 = np.dtype([("qint32", np.int32, (1,))])

# _np_bfloat16 is defined by a module import.

# Custom struct dtype for directly-fed ResourceHandles of supported type(s).
np_resource = np.dtype([("resource", np.ubyte, (1,))])

重新运行会发现警告消失:

技术分享图片

 

Python运行tensortflow出现FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated;

原文:https://www.cnblogs.com/1gaoyu/p/12591368.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!