使用CUDA10.1加上Tensorflow 2.0会出现AttributeError: module 'tensorflow' has no attribute 'ConfigProto'这个问题,这个是由于现在新版本中一些1.0版本的函数被和2.0版本函数区分开的缘故

 

所以,需要将

tf.ConfigProto

修改为

tf.compat.v1.ConfigProto

修改前

解决AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

修改后

解决AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

 

相关文章: