cannot import name 'get_config' from 'tensorflow.python.eager.context'
时间: 2023-11-14 21:04:45 浏览: 57
This error message usually occurs when you are trying to import the `get_config` function from `tensorflow.python.eager.context` module but it is not available or has been removed in the version of TensorFlow you are using.
To fix this issue, you can try the following:
1. Make sure you have the latest version of TensorFlow installed. You can upgrade to the latest version by running the command `pip install --upgrade tensorflow`.
2. If you are using an older version of TensorFlow and need to use `get_config`, you can try downgrading to a compatible version by running `pip install tensorflow==<version>` where `<version>` is the version number you want to install.
3. Check if there is an alternative function or method that you can use instead of `get_config`. You can refer to the TensorFlow documentation or search for solutions on forums or GitHub issues.
4. If none of the above solutions work, you can try using a different TensorFlow module that has the functionality you need.