【发布时间】:2018-06-20 18:13:06
【问题描述】:
我已经使用 CMake 为 Windows 构建了 TensorFlow C++,并且能够运行一些示例。但是,当尝试对我自己的模型执行预测时,我收到以下错误消息:
执行程序未能创建内核。无效参数:NodeDef 提及 attr 'dilations' 不在 Op 中
和
检查您的 GraphDef 解释二进制文件是否与您的 GraphDef 生成二进制文件是最新的。
我已经使用 Keras 和 tf 1.5 训练了我的模型。该模型使用 adam 作为优化器,是一个简单的基于 ResNet50 的模型。我使用this 脚本将 Keras 模型转换为 TensorFlow,它在 TensorFlow for Python 上运行良好。
有什么想法吗?
这是完整的日志:
2018-02-23 08:32:39.588610: E C:\Visual Studio 2015\Projects\tensorflow\tensorflow\core\common_runtime\executor.cc:643] Executor failed to create kernel. Invalid argument: NodeDef mentions attr 'dilations' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]>; NodeDef: conv1/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/cpu:0"](zeropadding2d_1/Pad, conv1/kernel). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
[[Node: conv1/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/cpu:0"](zeropadding2d_1/Pad, conv1/kernel)]]
2018-02-23 08:32:39.637876: E matmul.cpp:357] Running model failed: Invalid argument: NodeDef mentions attr 'dilations' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]>; NodeDef: conv1/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/cpu:0"](zeropadding2d_1/Pad, conv1/kernel). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
[[Node: conv1/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/cpu:0"](zeropadding2d_1/Pad, conv1/kernel)]]
我正在使用 Windows 10 x64 和使用 CMake 构建的 TensorFlow 和 Visual Studio 2015。
谢谢!
【问题讨论】:
标签: c++ tensorflow