当前位置: 代码迷 >> 综合 >> 报错:FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated
  详细解决方案

报错:FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated

热度:100   发布时间:2023-11-17 08:10:40.0

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_resource = np.dtype([(“resource”, np.ubyte, 1)])

  • 原因:安装的tensorflow版本和numpy版本不匹配。需要将numpy降版本。
    我的tensorflow版本: ‘1.12.0’,numpy版本“1.18.0”报错,我将numpy降为1.16.0不报错
  1. 方法一:终端:重新下载numpy
pip install numpy==1.16.0
  1. 方法二:如果有anaconda,可以在界面降级:
    在这里插入图片描述
  相关解决方案