formath/tensorflow-predictor-cpp

Have you solved the problem? No OpKernel was registered to support Op 'SegmentSum'

painmoth opened this issue · 11 comments

tensorflow/tensorflow#13897

hello,I have forked your project and encounter the same problem

This problem has been fixed a long time ago. Please update your Tensorflow.

But my tensorflow is up to date(1.7)

Please put your errors here.

I have tried 2 way, both have some errors, thanks
tensorflow-predictor-cpp/demo/deep_model]$sh ./predict.sh

#./predict.sh
export TF_CPP_MIN_LOG_LEVEL=3
#../../bin/deep_model.bin "9,6,116,152,179" "./data/dict.data" "./model/graph.pb"
../../bin/deep_model.bin "9,6,116,152,179" "./data/dict.data" "./model/freeze_graph.pb"

ERROR message:
Invalid argument: Multiple OpKernel registrations match NodeDef 'emb_179/embedding_lookup_sparse = SegmentSum[T=DT_FLOAT, Tindices=DT_INT32](emb_179/embedding_lookup_sparse/mul, emb_179/embedding_lookup_sparse/Cast)': 'op: "SegmentSum" device_type: "CPU" constraint { name: "T" allowed_values { list { type: DT_FLOAT } } } constraint { name: "Tindices" allowed_values { list { type: DT_INT32 } } }' and 'op: "SegmentSum" device_type: "CPU" constraint { name: "T" allowed_values { list { type: DT_FLOAT } } } constraint { name: "Tindices" allowed_values { list { type: DT_INT32 } } }'
[[Node: emb_179/embedding_lookup_sparse = SegmentSum[T=DT_FLOAT, Tindices=DT_INT32](emb_179/embedding_lookup_sparse/mul, emb_179/embedding_lookup_sparse/Cast)]]

#./predict.sh
export TF_CPP_MIN_LOG_LEVEL=3
../../bin/deep_model.bin "9,6,116,152,179" "./data/dict.data" "./model/graph.pb"
#../../bin/deep_model.bin "9,6,116,152,179" "./data/dict.data" "./model/freeze_graph.pb"

ERROR message:
Invalid argument: No OpKernel was registered to support Op 'L2Loss' with these attrs. Registered devices: [CPU], Registered kernels:

 [[Node: get_regularization_penalty_1/l2_regularizer_1/L2Loss = L2Loss[T=DT_FLOAT](outlayer/bias_out/read)]]

Check whether tensorflow/core/kernels/segment_reduction_ops.cc exists in the file tensorflow/contrib/makefile/tf_op_files.txt. Add it if not.

yes, I have checked...

cat tensorflow/contrib/makefile/tf_op_files.txt|grep -in "tensorflow/core/kernels/segment_reduction_ops.cc"
47:tensorflow/core/kernels/segment_reduction_ops.cc
302:tensorflow/core/kernels/segment_reduction_ops.cc

May I give you a call or add my wechat 13466781043?

I tested it again and don't find your problem. My env is:

installed tensorflow version: 1.7.0
tensorflow source code used in `build_all_linux.sh`: 
        https://github.com/formath/tensorflow.git   branch: fix

Thanks a lot for your help! I have rebuild it, but may be the essential problem is the same.

Session created successfully
Load graph protobuf successfully
Not found: Op type not registered 'HashTableV2' in binary running on MacbookPro. Make sure the Op and Kernel are registered in the binary running in this process.

I have fixed this problem in the branch fix. Did you use the same env listed above?

It's ok now,thanks a lot for your help! Must use you fixed version branch,https://github.com/formath/tensorflow.git origin/fix