You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
com.chaquo.python.PyException: Exception: [Errno 30] Read-only file system: '../assets'. Cache may be out of date, try force_reload=True or see https://github.com/ultralytics/yolov5/issues/36 for help
#824
Closed
iammohit1311 opened this issue
Mar 19, 2023
· 4 comments
I am trying to load my custom YOLOv5 model using PyTorch. Then run predictions and save cropped results. However, it seems Chaquopy is not able to read my model named 'best.pt' present in 'assets' directory @mhsmith
Chaquopy version
id 'com.chaquo.python' version '14.0.2' apply false
Relevant parts of my code
This is what I have in my python file:
import torch
model = torch.hub.load('ultralytics/yolov5', 'custom', path='../assets/best.pt', force_reload=True)
im = img_url
# Inference
results = model(im)
# Results
results.crop(save_dir="./result") # or .show(), .save(), .crop(), .pandas(), etc.
Describe your issue
Stack trace
W/python.stderr: �[31m�[1mrequirements:�[0m YOLOv5 requirement "matplotlib>=3.2.2" not found, attempting AutoUpdate...
W/python.stderr: �[31m�[1mrequirements:�[0m ❌ Command 'pip install "matplotlib>=3.2.2" ' returned non-zero exit status 127.
W/python.stderr: YOLOv5 🚀 2023-3-19 Python-3.8.16 torch-1.8.1 CPU
W/python.stderr:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.firebasetest, PID: 12820
com.chaquo.python.PyException: Exception: [Errno 30] Read-only file system: '../assets'. Cache may be out of date, try force_reload=True or see https://github.com/ultralytics/yolov5/issues/36 for help.
at .hubconf.py._create(hubconf.py:78)
at .hubconf.py.custom(hubconf.py:83)
at .torch.hub._load_local(hub.py:368)
at .torch.hub.load(hub.py:339)
at .yoloscript.main(yoloscript.py:29)
at .chaquopy_java.call(chaquopy_java.pyx:354)
at .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 com.example.firebasetest.MainActivity.detect(MainActivity.kt:113)
at com.example.firebasetest.MainActivity$uploadFile$1$1$1.invoke(MainActivity.kt:98)
at com.example.firebasetest.MainActivity$uploadFile$1$1$1.invoke(MainActivity.kt:95)
at com.example.firebasetest.MainActivity$uploadFile$1$1.invoke$lambda$0(MainActivity.kt:95)
at com.example.firebasetest.MainActivity$uploadFile$1$1.$r8$lambda$AUdobY3vHU2uvJPt71kXe-c4xGs(Unknown Source:0)
at com.example.firebasetest.MainActivity$uploadFile$1$1$$ExternalSyntheticLambda0.onSuccess(Unknown Source:2)
at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process: Sending signal. PID: 12820 SIG: 9
The text was updated successfully, but these errors were encountered:
The current directory could be anywhere on Android, so you must use absolute paths. See the FAQ sections "Read files in Python" and "Write files in Python".
I am trying to load my custom YOLOv5 model using PyTorch. Then run predictions and save cropped results. However, it seems Chaquopy is not able to read my model named 'best.pt' present in 'assets' directory @mhsmith
Chaquopy version
id 'com.chaquo.python' version '14.0.2' apply false
Relevant parts of my code
This is what I have in my python file:
Describe your issue
Stack trace
W/python.stderr: �[31m�[1mrequirements:�[0m YOLOv5 requirement "matplotlib>=3.2.2" not found, attempting AutoUpdate...
W/python.stderr: �[31m�[1mrequirements:�[0m ❌ Command 'pip install "matplotlib>=3.2.2" ' returned non-zero exit status 127.
W/python.stderr: YOLOv5 🚀 2023-3-19 Python-3.8.16 torch-1.8.1 CPU
W/python.stderr:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.firebasetest, PID: 12820
com.chaquo.python.PyException: Exception: [Errno 30] Read-only file system: '../assets'. Cache may be out of date, try
force_reload=True
or see https://github.com/ultralytics/yolov5/issues/36 for help.at .hubconf.py._create(hubconf.py:78)
at .hubconf.py.custom(hubconf.py:83)
at .torch.hub._load_local(hub.py:368)
at .torch.hub.load(hub.py:339)
at .yoloscript.main(yoloscript.py:29)
at .chaquopy_java.call(chaquopy_java.pyx:354)
at .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 com.example.firebasetest.MainActivity.detect(MainActivity.kt:113)
at com.example.firebasetest.MainActivity$uploadFile$1$1$1.invoke(MainActivity.kt:98)
at com.example.firebasetest.MainActivity$uploadFile$1$1$1.invoke(MainActivity.kt:95)
at com.example.firebasetest.MainActivity$uploadFile$1$1.invoke$lambda$0(MainActivity.kt:95)
at com.example.firebasetest.MainActivity$uploadFile$1$1.$r8$lambda$AUdobY3vHU2uvJPt71kXe-c4xGs(Unknown Source:0)
at com.example.firebasetest.MainActivity$uploadFile$1$1$$ExternalSyntheticLambda0.onSuccess(Unknown Source:2)
at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process: Sending signal. PID: 12820 SIG: 9
The text was updated successfully, but these errors were encountered: