Loading keras models in Android environment

Hi

I’ve downloaded keras models onto the android environment using Chaquopy which is a 3rd party API allowing to interface python with Java, so theree’s a python backend I can write code in and upload it with a Java Android app.

The error is thrown when I try to load a saved model in the python environment (I’m open to alternatives).

Any and all help is much appreciated!

My error is as follows:

 com.chaquo.python.PyException: NotFoundError: Op type not registered 'DisableCopyOnRead' in binary running on localhost. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
                                                                                                    	at <python>.tensorflow.python.framework.ops._get_op_def(ops.py:3712)
                                                                                                    	at <python>.tensorflow.python.framework.function_def_to_graph.function_def_to_graph_def(function_def_to_graph.py:218)
                                                                                                    	at <python>.tensorflow.python.framework.function_def_to_graph.function_def_to_graph(function_def_to_graph.py:58)
                                                                                                    	at <python>.tensorflow.python.saved_model.function_deserialization.load_function_def_library(function_deserialization.py:312)
                                                                                                    	at <python>.tensorflow.python.saved_model.load.__init__(load.py:113)
                                                                                                    	at <python>.tensorflow.python.keras.saving.saved_model.load.__init__(load.py:118)
                                                                                                    	at <python>.tensorflow.python.saved_model.load.load_internal(load.py:550)
                                                                                                    	at <python>.tensorflow.python.keras.saving.saved_model.load.load(load.py:89)
                                                                                                    	at <python>.tensorflow.python.keras.saving.save.load_model(save.py:150)
                                                                                                    	at <python>.backend.download_models(backend.py:54)
                                                                                                    	at <python>.chaquopy_java.call(chaquopy_java.pyx:354)
                                                                                                    	at <python>.chaquopy_java.Java_com_chaquo_python_PyObject_callAttrThrowsNative(chaquopy_java.pyx:326)
                                                                                                    	at com.chaquo.python.PyObject.callAttrThrowsNative(Native Method)
                                                                                                    	at com.chaquo.python.PyObject.callAttrThrows(PyObject.java:232)
                                                                                                    	at com.chaquo.python.PyObject.callAttr(PyObject.java:221)
                                                                                                    	at ca.mcmaster.testsuitecommon.SplashActivity$1.onClick(SplashActivity.java:99)
                                                                                                    	at android.view.View.performClick(View.java:7892)
                                                                                                    	at android.widget.TextView.performClick(TextView.java:16219)
                                                                                                    	at android.view.View.performClickInternal(View.java:7869)
                                                                                                    	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
                                                                                                    	at android.view.View$PerformClick.run(View.java:30880)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:942)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:226)
                                                                                                    	at android.os.Looper.loop(Looper.java:313)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8757)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)