栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

解决报错: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

解决报错: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

在跑Bert源码的时候发现出了个小bug

连续报两个Warning

  • The name tf.train.Optimizer is deprecated. Please use
    tf.compat.v1.train.Optimizer instead.
  • The name tf.app.run is deprecated. Please use tf.compat.v1.app.run
    instead.

由于我用的是TensorFlow1.15.0和CUDA10.0的版本,想着是不是版本不合适,所以将其卸载,并移除虚拟环境。

pip uninstall tensorflow


别忘了卸载干净

接下来重新安装TensorFlow低版本即可

conda create -n tensorflow pip python=3.7
activate tensorflow
conda install tensorflow=1.13.1
//gpu 用下面这个
conda install tensorflow-gpu=1.13.1

注意TensorFlow,CUDA和Python版本相对应

点击查看官网现在对应版本

参考:https://github.com/keras-team/keras/issues/13004

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/355736.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号