close

[Solved] AttributeError: module ‘tensorflow’ has no attribute ‘compat’ when loading tf.compat.v1.train.SessionRunHook

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error AttributeError: module ‘tensorflow’ has no attribute ‘compat’ when loading tf.compat.v1.train.SessionRunHook in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How AttributeError: module ‘tensorflow’ has no attribute ‘compat’ when loading tf.compat.v1.train.SessionRunHook Error Occurs?

Today I get the following error AttributeError: module ‘tensorflow’ has no attribute ‘compat’ when loading tf.compat.v1.train.SessionRunHook in Python.

How To Solve AttributeError: module ‘tensorflow’ has no attribute ‘compat’ when loading tf.compat.v1.train.SessionRunHook Error ?

  1. How To Solve AttributeError: module 'tensorflow' has no attribute 'compat' when loading tf.compat.v1.train.SessionRunHook Error ?

    To Solve AttributeError: module 'tensorflow' has no attribute 'compat' when loading tf.compat.v1.train.SessionRunHook Error Below solution worked for me. Reference
    First install Estimator=2.1 then the rest:

Solution 1

This is usually caused by the broken TensorFlow-estimator module.

simply do a

pip install tensorflow-estimator==2.1.*

Solution 2

Below solution worked for me. Reference

First install Estimator=2.1 then the rest:

conda remove tensorflow
conda install tensorflow-estimator 2.1
conda install tensorflow-gpu=2.1

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment