Create constant op
s3 · run_code migrateIn TensorFlow 2.x eager execution, tensors evaluate immediately. Printing the tensor directly shows its value without needing a session.
Sources
- Fixing the "AttributeError: module 'tensorflow' has no attribute 'Session'" Error - GeeksforGeeks
The error message "AttributeError: module 'tensorflow' has no attribute 'Session'" typically occurs when using TensorFlow version 2.x. This error is due to the fact that the `Session` object, which was a core component in TensorFlow 1.x for executing operations in a computational graph, has been removed in TensorFlow 2.x. The new version of TensorFlow defaults to eager execution, which evaluates operations immediately without the need for a session, making the development process more intuitive and straightforward. [...] ## Why Does This Error Occur?
- Module: tf.compat.v1 | TensorFlow v2.16.1
`class InteractiveSession`: A TensorFlow `Session` for use in interactive contexts, such as a shell.