解决:AttributeError: module ‘tensorflow‘ has no attribute ‘python_io‘

出错现象:

解决:AttributeError: module ‘tensorflow‘ has no attribute ‘python_io‘_第1张图片

问题分析:

这个问题是tensorflow版本不同引起的,tensorflow2中并没有python_io这个模块了,所以就需要在tensorflow2环境下调用tensorflow1版本的模块。

解决办法:

解决:AttributeError: module ‘tensorflow‘ has no attribute ‘python_io‘_第2张图片

在tensorflow2环境下使用tf.compat.v1.模块名,就可以实现tensorflow1中的函数或者功能模块调用了

你可能感兴趣的:(tensorflow,python,深度学习)