[Solved] Python Error: tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.

environment

Environment: docker
System: Ubuntu 18.04
graphics card: RTX 1080ti
tf-v: 1.15.0

Run the neural network model and report the error of the title

The screenshot of the error is as follows:

solution:

Add the following code after the import of the entry file:

config = tf.compat.v1.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.6  # 0.6 sometimes works better for folks
keras.backend.tensorflow_backend.set_session(tf.compat.v1.Session(config=config))

Limit the running memory of Tensorflow

Read More: