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

解决AttributeError: module ‘tensorflow’ has no attribute ‘ConfigProto’

error

Error when executing tf.ConfigProto
Insert picture description here

Cause of error

This is caused by the incompatibility between the usage of tensorflow 2.0 version and 1.0 version

Error resolution

Change tf.ConfigProto to tf.compat.v1.ConfigProto
to solve
Insert picture description here

Guess you like

Origin blog.csdn.net/zjlwdqca/article/details/111414184