当前位置:网站首页>【Tensorflow】AttributeError: '_TfDeviceCaptureOp' object has no attribute '_set_device_from_string'

【Tensorflow】AttributeError: '_TfDeviceCaptureOp' object has no attribute '_set_device_from_string'

2022-08-02 14:00:00 there2belief

Question:

When using keras' multi_gpu_model

from keras.utils import multi_gpu_modelmodel = load_model()p_model = multi_gpu_model(model)

An error occurred:

AttributeError: '_TfDeviceCaptureOp' object has no attribute '_set_device_from_string'

The operating environment is:

tensorflow=1.15.0

keras=2.2.4

Resolve:

The reason for this error is The two versions do not match. Using keras=2.2.4 requires a matching tensorflow version, such as 1.13.1.If you want to use tensorflow1.15.0, you can use keras=2.3.1.

Version match reference:

原网站

版权声明
本文为[there2belief]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208021351195269.html