Tensorflow reported an error when using session module: attributeerror: module ‘tensorflow’ has no attribute ‘session’, which has been solved

This function can only be invoked before creating any graph, operation or tensor. It can be used at the beginning of a complex migration project from tensorflow 1. X to 2. X.

A simpler method is found. When referring to tensorflow, you can directly use:
Import tensorflow.compat.v1 as TF

Read More: