当前位置:网站首页>【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。
版本匹配参考:

边栏推荐
- 基于华为eNSP的企业网络规划
- [typescript] Use the RangePicker component in antd to implement time limit the previous year (365 days) of the current time
- 【ONE·Data || Getting Started with Sorting】
- Why does a four-byte float represent a wider range than an eight-byte long
- SQL函数 UPPER
- 如何通过DBeaver 连接 TDengine?
- RHCE第一天作业
- GTK:Gdk-CRITICAL **: IA__gdk_draw_pixbuf: assertion ‘GDK_IS_DRAWABLE (drawable)‘ failed
- WiFi Association&Omnipeek抓包分析
- 网络安全第五次作业
猜你喜欢
随机推荐
C language improvement (3)
MySQL - ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
使用Amazon SageMaker 构建基于自然语言处理的文本摘要应用
【C语言】手撕循环结构 —— for语句
标量替换、栈上分配、同步消除
RISC-V instruction format and 6 basic integer instructions
static修饰的函数有什么特点(static可以修饰所有的变量吗)
GTK:Gdk-CRITICAL **: IA__gdk_draw_pixbuf: assertion ‘GDK_IS_DRAWABLE (drawable)’ failed
基于华为eNSP的企业网络规划
Oracle数据库的闪回技术
Mysql视图
巴比特 | 元宇宙每日必读:蒂芙尼宣布推出限量版 CryptoPunk 定制吊坠
存储过程详解
腾讯安全发布Tencent Cloud EdgeOne,为企业出海打造安全加速一体化服务
【C语言】夏日一题 —— 求最大公约数和最小公倍数
Flutter 实现光影变换的立体旋转效果
【ONE·Data || Getting Started with Sorting】
Reading IDEO, Design Changes Everything
【622. 设计循环队列】
【C语言】剖析函数递归(2)







![[C language] Explicit array solution (1)](/img/d2/26e3e64bb07578a6348747c00abb64.png)

