Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

custom model cannot load in android using HelloWorld example, but successfully loaded with cpp? #49

Open
lynx97 opened this issue Jan 2, 2020 · 2 comments

Comments

@lynx97
Copy link

lynx97 commented Jan 2, 2020

I have converted model (MORAN - https://github.com/Canjie-Luo/MORAN_v2) with torch script, I used pytorch=1.3.1, torchvision=0.4.2.
When I tried to load with cpp, It worked. But when load model in Android using HelloWorld example, there was an error:
Unable to start activity ComponentInfo{org.pytorch.helloworld/org.pytorch.helloworld.MainActivity}: com.facebook.jni.CppException: false CHECK FAILED at ../c10/core/Backend.h (tensorTypeIdToBackend at ../c10/core/Backend.h:106)

line code to load model: module = Module.load(assetFilePath(this, model_name));

@ashbringerf
Copy link

similar issue, demo can work, self trained model works on computer while crash on cellphone.

@ashbringerf
Copy link

similar issue, demo can work, self trained model works on computer while crash on cellphone.

Sorry, I used 2 classes, and TOP K is 3; after using android studio debug I fixed my issue, and I also train it on GPU with CUDA float, after serialization CPU model on CPU. error is gone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants