在tensorflow

时间:2018-03-23 13:53:02

标签: tensorflow tensorflow-serving

我使用tensorflow服务模块从预先训练的resnet50模型创建了一个已保存的模型。但是当我尝试运行模型服务器时,我收到了这个错误:

  

2018-03-23 13:36:37.130839:E external / org_tensorflow / tensorflow / core / common_runtime / executor.cc:651] Executor无法创建内核。参数无效:NodeDef提到了attr' dilations'不在Op输出:T; attr = T:type,allowed = [DT_HALF,DT_FLOAT]; ATTR =步幅:列表(INT); ATTR = use_cudnn_on_gpu:布尔,默认= TRUE; attr = padding:string,allowed = [" SAME"," VALID"];   attr = data_format:string,default =" NHWC",allowed = [" NHWC"," NCHW"]&gt ;; NodeDef:FirstStageFeatureExtractor / resnet_v1_50 / resnet_v1_50 / conv1 / Conv2D = Conv2D [T = DT_FLOAT,data_format =" NHWC&#34 ;, dilations = [1,1,1,1],padding =" VALID&#34 ;,strides = [1,2,2,1],use_cudnn_on_gpu = true,_device =" / job:localhost / replica:0 / task:0 / device:CPU:0"](FirstStageFeatureExtractor / resnet_v1_50 / resnet_v1_50 / Pad,FirstStageFeatureExtractor / resnet_v1_50 / conv1 / weights / read)。 (检查GraphDef解释二进制文件是否与生成GraphDef的二进制文件保持同步。)。        [[Node:FirstStageFeatureExtractor / resnet_v1_50 / resnet_v1_50 / conv1 / Conv2D = Conv2D [T = DT_FLOAT,data_format =" NHWC",dilations = [1,1,1,1],padding =" VALID& #34;,strides = [1,2,2,1],use_cudnn_on_gpu = true,_device =" / job:localhost / replica:0 / task:0 / device:CPU:0"](FirstStageFeatureExtractor / resnet_v1_50 / resnet_v1_50 / Pad,FirstStageFeatureExtractor / resnet_v1_50 / conv1 / weights / read)]]

1 个答案:

答案 0 :(得分:0)

嗯,它告诉你什么是错的,尽管在所有细节下可能很难看到:

“检查您的GraphDef解释二进制文件是否与生成GraphDef的二进制文件保持同步”

您似乎使用的是最新版本的TensorFlow,它为Conv2D添加了“dilations”参数。

tensorflow_model_server中的TensorFlow版本比这更老,因此不知道如何实例化该运算符。

尝试在较旧的TensorFlow版本上重建模型,或尝试使用较新的TensorFlow版本创建tensorflow_model_server。

在当前的TensorFlow服务池中,可以使用

轻松完成
bazel build --action_env TF_REVISION="{git hash}" //tensorflow_serving/model_servers:tensorflow_model_server

有关详细信息,请参阅https://github.com/tensorflow/serving/commit/f9e602c753ef82ff96b28429dd07e900f10eb007