module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices'
时间: 2023-10-11 20:11:56 浏览: 121
问题解决:module 'tensorflow.compat.v1' has no attribute '
5星 · 资源好评率100%
This error occurs when you are trying to use the `list_physical_devices` function from the `tensorflow_core._api.v2.config` module, but this function is not available in the module.
To fix this error, you can try using the `list_physical_devices` function from the `tensorflow` module instead. Here's an example:
```
import tensorflow as tf
# get list of all available physical devices
physical_devices = tf.config.list_physical_devices()
# print the list of physical devices
print(physical_devices)
```
This should print a list of all the physical devices available on your system that can be used for running TensorFlow computations.
阅读全文