thammegowda / tensorflow-grpc-java

Tensorflow grpc java client for image recognition serving inception model
Apache License 2.0
39 stars 15 forks source link

StatusRuntimeException: UNIMPLEMENTED #4

Open newyangyang opened 7 years ago

newyangyang commented 7 years ago

I got error like :

Exception in thread "main" io.grpc.StatusRuntimeException: UNIMPLEMENTED
        at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:210)
        at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:191)
        at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:124)
        at edu.usc.irds.tensorflow.grpc.InceptionBlockingStub.classify(InceptionBlockingStub.java:63)
        at edu.usc.irds.tensorflow.grpc.TensorflowObjectRecogniser.recognise(TensorflowObjectRecogniser.java:67)
        at edu.usc.irds.tensorflow.grpc.Main.main(Main.java:49)

Not sure whether the client side or the server side is broken. The server is running and image is ready, may be something about the protocol. Do you have a clue?

UPDATE: I am not running inception-model but MNIST-model, did this could cause the error? If so, how can I change the code to the MNIST-model?

thammegowda commented 7 years ago

I am not running inception-model but MNIST-model, did this could cause the error? If so, how can I change the code to the MNIST-model?

Yes that could be the issue. The code is tested with Inception model.

Have a look at the src/main/java/edu/usc/irds/tensorflow/grpc

I think you have to generate the Stub and Inference files for the MNIST Model. Hint: You can find the .proto files from tensorflow serving project and use the proto compiler to generate Java source files. Then you can swap those files.

thammegowda commented 7 years ago

@newyangyang this project was done more than a year ago. Back then there were no examples for Java-based GRPC client (literally 0 working examples). FYI, this example works with a specific example given a year ago.

You can pull a docker and test it (I tested it today and it still works!):

# pull and start the prebuilt container, forward port 9000
docker run -it -p 9000:9000 tgowda/inception_serving_tika

# Inside the container, start tensorflow service
root@8311ea4e8074:/# /serving/server.sh

The situation may be changed now. The server side may be more generalized to accommodate more models. I would be interested to hear if you find anything.

thammegowda commented 7 years ago

FYI, The Java files for inference were generated from https://github.com/tensorflow/serving/blob/7186872c228ce0a9462993cf8cffba8c1b8a202d/tensorflow_serving/example/inception_inference.proto

The MNIST file you are looking for is here: https://github.com/tensorflow/serving/blob/7186872c228ce0a9462993cf8cffba8c1b8a202d/tensorflow_serving/example/mnist_inference.proto

To know how to generate Java files from proto files: https://developers.google.com/protocol-buffers/docs/reference/java-generated

FYI - all those files are deleted from repository now and replaced with more generic APIs https://github.com/tensorflow/serving/tree/f8c779f6525749d5d7835b4fb8dcb6a8d80af035/tensorflow_serving/apis

So, if your project depends on this, I recommend updating to current version! I see you already gave a PR #3 👍 Thanks, I am going to accept it. However, if you manage to update the Java files with newer .protos I will thank you for your service!! Let me know if you need my help!

jiangcore commented 6 years ago

I have met the same problem and python client of inception can well call the inception serving, could you help to solve this problem? Thanks.

Here is the running problem: [WARNING] io.grpc.StatusRuntimeException: UNIMPLEMENTED at io.grpc.stub.ClientCalls.toStatusRuntimeException (ClientCalls.java:210) at io.grpc.stub.ClientCalls.getUnchecked (ClientCalls.java:191) at io.grpc.stub.ClientCalls.blockingUnaryCall (ClientCalls.java:124) at edu.usc.irds.tensorflow.grpc.InceptionBlockingStub.classify (InceptionBlockingStub.java:64) at edu.usc.irds.tensorflow.grpc.TensorflowObjectRecogniser.recognise (TensorflowObjectRecogniser.java:67) at edu.usc.irds.tensorflow.grpc.Main.main (Main.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282) at java.lang.Thread.run (Thread.java:748) [WARNING] thread Thread[grpc-default-worker-ELG-1-1,5,edu.usc.irds.tensorflow.grpc.Main] was interrupted but is still alive after waiting at least 14999msecs [WARNING] thread Thread[grpc-default-worker-ELG-1-1,5,edu.usc.irds.tensorflow.grpc.Main] will linger despite being asked to die via interruption [WARNING] thread Thread[grpc-default-executor-0,5,edu.usc.irds.tensorflow.grpc.Main] will linger despite being asked to die via interruption [WARNING] thread Thread[grpc-default-worker-ELG-1-2,5,edu.usc.irds.tensorflow.grpc.Main] will linger despite being asked to die via interruption [WARNING] thread Thread[threadDeathWatcher-3-1,1,edu.usc.irds.tensorflow.grpc.Main] will linger despite being asked to die via interruption [WARNING] thread Thread[grpc-default-worker-ELG-1-3,5,edu.usc.irds.tensorflow.grpc.Main] will linger despite being asked to die via interruption [WARNING] thread Thread[grpc-default-worker-ELG-1-4,5,edu.usc.irds.tensorflow.grpc.Main] will linger despite being asked to die via interruption [WARNING] NOTE: 6 thread(s) did not finish despite being asked to via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied. [WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=edu.usc.irds.tensorflow.grpc.Main,maxpri=10] java.lang.IllegalThreadStateException at java.lang.ThreadGroup.destroy (ThreadGroup.java:778) at org.codehaus.mojo.exec.ExecJavaMojo.execute (ExecJavaMojo.java:321) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17.707 s [INFO] Finished at: 2018-06-06T10:41:33-04:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project tensorflow-java: An exception occured while executing the Java class. UNIMPLEMENTED -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

MichaelGou1105 commented 5 years ago

@jiangcore do you slove it ?