
深度学习
文章平均质量分 56
200-
这个作者很懒,什么都没留下…
展开
-
tf2.0不降版本也能完美解决module ‘tensorflow’ has no attribute ‘contrib’ 等类似的问题
在使用tensorflow2.x版本的时候,如果使用调用tensorflow1.x函数的代码时,常常会出现module ‘tensorflow’ has no attribute ‘contrib’这样的问题,原因是tensorflow2.x废弃了很多tensorflow1.xAPI接口,本文针对常见的几种错误来使tf2.0不降版本也能运行代码报错AttributeError: module 'tensorflow' has no attribute 'random_normal'在报错的行数将tf.r原创 2021-01-27 23:28:03 · 21969 阅读 · 8 评论 -
RuntimeError: The Session graph is empty. Add operations to the graph before calling run().解决方法
问题产生的原因:无法执行sess.run()的原因是tensorflow版本不同导致的,tensorflow版本2.0无法兼容版本1.0.解决办法:tf.compat.v1.disable_eager_execution()import tensorflow as tftf.compat.v1.disable_eager_execution() #保证sess.run()能够正常运行hello = tf.constant('hello,tensorflow')sess= tf.compat.v1转载 2021-01-26 10:18:51 · 563 阅读 · 0 评论 -
解决pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool
解决pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out问题,今天安装alphaet包时发现,直接pip install alphabet会报错,报错信息是:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘f转载 2021-01-26 10:10:33 · 9381 阅读 · 0 评论