Both reset_default_graph and tensorflow.compat have version difference to use tensorflow in Python
From comments

In TF 2.x, you can use tf.compat.v1.reset_default_graph() instead of
reset_default_graph().
After disabling eager execution using
tensorflow.compat.v1.disable_eager_execution() has resolved the
issue.
I had some issues about using
'''
tensorflow.reset_default_graph
'''
,so I tried to downgrade the tensorflow version to 1.4.
And I had problem about:
'''
ModuleNotFoundError: No module named 'tensorflow.compat'
'''
.
The problem about reset_default_graph was in the version of tensorflow 2.0, and the version about tensorflow.compat was 1.4.