AttributeError: module 'tensorflow' has no attribute 'logging'. Did you mean: '_logging'?
时间: 2023-09-19 21:07:27 浏览: 129
attribute详细介绍
This error occurs when a module in TensorFlow tries to access the attribute "logging" but it is not available. In recent versions of TensorFlow, the "logging" module has been moved to a separate package called "absl.logging".
To fix this error, you can replace any instances of "import tensorflow.logging" with "import absl.logging" and update any references to "tensorflow.logging" with "absl.logging".
For example:
```
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.INFO)
# should be replaced with:
import absl.logging as logging
logging.set_verbosity(logging.INFO)
```
阅读全文