FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated的解决方案

1 问题描述

导入tensorflow时候出现很多个 FutureWarning警告:

如D:\Program\Anaconda3\envs\cat\lib\site-packages\tensorflow\python\framework\dtypes.py:516: 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'.

FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated的解决方案_第1张图片

2 解决方案pip install -U numpy==1.16.6

应该是numpy的版本和tensorflow不够契合,应该稍微降低numpy的版本。根据个人实际情况添加相应的numpy版本。我的tensorflow1.14.0+numpy1.16.0

一般情况下,使用这两个命令就可以。

pip uninstall numpy

pip install numpy

如果这两个命令还不行

那就使用

pip uninstall numpy

pip install -U numpy==1.16.6即可解决问题。

FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated的解决方案_第2张图片

你可能感兴趣的:(python,解决方案,python,tensorflow,anaconda,numpy)