web123456

attribute error: module tensor flow has no attribute config proto

The reason for this error is that the python code is based on TensorFlow1.0, and the TensorFlow version in the system is 2.0

So two solutions:

  1. Change the code of 1.0 to 2.0
  2. Reduce TensorFlow to 1.0

I chose the first method

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

An error occurs:

config = ()

Modified statement:

config = .()

akin:

AttributeError: module 'tensorflow' has no attribute 'Session'

An error occurs:

session = (config=config)

Modified statement:

session = .(config=config)

Also caused by version issues:

RuntimeError: set_session is not available when using TensorFlow 2.0.

An error occurs:

KTF.set_session(session)

Modified statement:

..set_session(session)