问题
Am using tensorflow 2.1 on windows 10 . on running
model.add(Conv3D(16, (22, 5, 5), strides=(1, 2, 2), padding='valid',activation='relu',data_format= "channels_first", input_shape=input_shape))
on spyder I get the above error. How can i solve this error ??
回答1:
I found the answer here - https://github.com/keras-team/keras/issues/13684.
I had the same issue for load_model()
from keras under Anaconda:
AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices'
I found source of problem in
...\anaconda3\envs\tf_env\Lib\site-packages\keras\backend\tensorflow_backend.py
In line 506 I changed line
_LOCAL_DEVICES = tf.config.experimental_list_devices()
to
devices = tf.config.list_logical_devices()
_LOCAL_DEVICES = [x.name for x in devices]
And it works
来源:https://stackoverflow.com/questions/60581677/attributeerror-module-tensorflow-core-api-v2-config-has-no-attribute-expe