Python调用TensorFlow时出现:FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated

发布时间 2023-04-07 11:11:41作者: Elaine_01

百度了很多说是numpy版本过高,将numpy版本降低即可,我降低为1.16.2
但是会碰到pip uninstall numpy卸载不掉的问题
我一直忽视了是在conda创建的虚拟环境acc中运行的这个代码,
进入cmd pip uninstall时没注意是在base环境下,还是在自己创建的虚拟环境下,
一直uninstall不掉numpy,原因我是在base的那个环境中
SO,
cmd中输入activate acc(我创建的虚拟环境名称)进入acc环境
pip uninstall numpy卸载掉了 接着pip install numpy=1.16.2
回到Pycharm运行代码,没有warning了