chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
809 stars 131 forks source link

No such file or directory #317

Closed Aman2612 closed 4 years ago

Aman2612 commented 4 years ago

Hi, I have a method wherein I need to load a tensorflow model.

def get_model_filenames(model_dir):

    files = os.listdir("model/tensorflow_models/20180408-102900/")
    print(files)

Upon running this via my terminal, it runs perfectly fine but gives the above error on my phone while running it. All the code is run from inside /python folder and I was trying to cross check it by printing the contents of the present directory but I get a permission error. Where am I going wrong?

Stack trace :

D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.salesmaintaner, PID: 21510 com.chaquo.python.PyException: FileNotFoundError: [Errno 2] No such file or directory: 'model/tensorflow_models/20180408-102900/' at .facenet.get_model_filenames(facenet.py:393) at .utils.load_model(utils.py:91) at .test.get_image(test.py:48) at .chaquopy_java.call(chaquopy_java.pyx:281) at .chaquopy_java.Java_com_chaquo_python_PyObject_callAttrThrows(chaquopy_java.pyx:253) at com.chaquo.python.PyObject.callAttrThrows(Native Method) at com.chaquo.python.PyObject.callAttr(PyObject.java:209) at com.example.salesmaintaner.newUser.getPythonText(newUser.java:78) at com.example.salesmaintaner.newUser.access$000(newUser.java:27) at com.example.salesmaintaner.newUser$1.onClick(newUser.java:43) at android.view.View.performClick(View.java:6669) at android.view.View.performClickInternal(View.java:6638) at android.view.View.access$3100(View.java:789) at android.view.View$PerformClick.run(View.java:26145) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) W/OPDiagnose: getService:OPDiagnoseService NULL D/OSTracker: OS Event: crash D/AbstractTracker: Event success I/Process: Sending signal. PID: 21510 SIG: 9

mhsmith commented 4 years ago

See #144.