JieHe96/iOS_Tensorflow_ObjectDetection_Example

Still got "No OpKernel was registered to support Op 'Less' " issues.

Closed this issue · 2 comments

Sorry to bother you again. I still have this issue when I try to load the static library into the official tensorflow-ios camera code. However, the same library works fine for your code. So could I assume the ops had successfully generated as in ops_to_register.h?

Couldn't load model: Invalid argument: No OpKernel was registered to support Op 'Less' with these attrs. Registered devices: [CPU], Registered kernels:
device='CPU'; T in [DT_FLOAT]

I am wondering what trick did you use to avoid this error? In the official project, I use install pods as package manager. Is that the problem? It seems my less op only registered with float, not int32 as in the ssd-mobilenet model, although in ops to register, the line - "BinaryOp< CPUDevice, functor::less>" is listed.

I am desperate with this weird issue. Could you please help me with it? ToT

hello ,have your issue be solved?I have the same issue.

3.Generate ops_to_register.h
One of the biggest issues during iOS Tensorflow building is the missing of different OpKernel. One may get similar errors like below:
Invalid argument: No OpKernel was registered to support Op 'Equal' with these attrs. Registered devices: [CPU], Registered kernels:

In order to solve the problems in one time, we use Bazel to generate a ops_to_register.h, which contains all the needed Ops to loading the certain graph into project. An example of command-line usage is:
bazel build tensorflow/python/tools:print_selective_registration_header
bazel-bin/tensorflow/python/tools/print_selective_registration_header
--graphs=path/to/graph.pb > ops_to_register.h
This will generate a ops_to_register.h file in the current directory. Copy the file to "tensorflow/core/framework/". Then when compiling tensorflow, pass -DSELECTIVE_REGISTRATION and -DSUPPORT_SELECTIVE_REGISTRATION See tensorflow/core/framework/selective_registration.h for more details.