当前位置:网站首页>【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 13:51:00 【there2belief】
问题:
使用keras的multi_gpu_model时
from keras.utils import multi_gpu_model
model = load_model()
p_model = multi_gpu_model(model)出现错误:
AttributeError: '_TfDeviceCaptureOp' object has no attribute '_set_device_from_string'运行环境是:
tensorflow=1.15.0
keras=2.2.4
解决:
出现该错误的原因是两者版本不匹配,使用keras=2.2.4需要匹配的tensorflow版本,例如1.13.1。如果想用tensorflow1.15.0则可以使用keras=2.3.1。
版本匹配参考:

边栏推荐
猜你喜欢
随机推荐
Mysql视图
C language improvement (3)
【学习笔记】数位dp
【C语言】手撕循环结构 —— while语句
【ONE·Data || 排序入门】
保姆级教程:写出自己的移动应用和小程序(篇三)
Awesome!Alibaba interview reference guide (Songshan version) open source sharing, programmer interview must brush
Fabric.js 动态设置字号大小
【C语言】剖析函数递归(3)
玉溪卷烟厂通过正确选择时序数据库 轻松应对超万亿行数据
第二讲 软件生命周期
binary search && tree
攻防世界----unfinish
rhce第三天作业
"Second Uncle" is popular, do you know the basic elements of "exploding" short videos from the media?
Summer training camp-week2 graph theory
MySQL - ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
Mysql index details (with pictures and texts)
leetcode 504. Base 7 七进制数 (简单)
Embedded system driver primary [2] - based on character device driver _ basic framework









