abdelaziz-mahdy / pytorch_lite

flutter package to help run pytorch lite models classification and YoloV5 and YoloV8.
MIT License
51 stars 22 forks source link

Invalid argument(s): Failed to lookup symbol 'load_ml_model': dlsym(RTLD_DEFAULT, load_ml_model): symbol not found #36

Closed tnghieu closed 1 year ago

tnghieu commented 1 year ago

When using await PytorchLite.loadClassificationModel( "assets/models/best.pt", 640, 480, 9, labelPath: "assets/labels/labels.txt", );

abdelaziz-mahdy commented 1 year ago

What platform are you testing on,

Also did you close the app and rebuild it after adding the package?

tnghieu commented 1 year ago

iOS

Yes, I also tried cleaning and removing the podfile.

abdelaziz-mahdy commented 1 year ago

I will try to test, but can you provide an example repo? Or configuration since my integration tests work

tnghieu commented 1 year ago

https://github.com/tnghieu/sharkeye

abdelaziz-mahdy commented 1 year ago

Hello, thank you for the repo, sadly I am not available this week

tnghieu commented 1 year ago

Hi @zezo357, I've made updates and used the export to torchscript and I am still seeing the same error. Is this compatible with iOS?

abdelaziz-mahdy commented 1 year ago

Using my GitHub actions, yes it works on both iOS and Android

I will need more details, like the version you are using in pubspec

Flutter doctor -v

tnghieu commented 1 year ago

[✓] Flutter (Channel stable, 3.13.1, on macOS 13.5 22G74 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.80.2) [✓] Connected device (3 available) [✓] Network resources

pytorch_lite: ^4.0.0

My repo has latest changes with the model weights.

abdelaziz-mahdy commented 1 year ago

Thank you, can you wait for next weekend? Since I can't try now as I mentioned

tnghieu commented 1 year ago

Yes I can wait. Thank you for your time.

abdelaziz-mahdy commented 1 year ago

been trying for a while the only solution i found is to add the cpp file in Compile Source in xcode

which is a very bad workaround since whenever i update the package you will have to update it

so i am thinking of going back to native (java and objc)

i will try to maintain new interface and just change the back logic

sadly it may take sometime to completely migrate back and add the ios logic since i dont understand obj c or swift

sorry for the inconvenience and if i can help with something else let me know

btw loved the idea of your project simple and does the job very good

tnghieu commented 1 year ago

Thank you. I look forward to the updates.

tnghieu commented 1 year ago

Hi @zezo357 , I see you've made a new update/PR. Thank you for the work!

I do have a question - does this library support object detection models? I ask because google-ml-object-detection library in Flutter can only use custom image classification models.

abdelaziz-mahdy commented 1 year ago

Hi @zezo357 , I see you've made a new update/PR. Thank you for the work!

I do have a question - does this library support object detection models? I ask because google-ml-object-detection library in Flutter can only use custom image classification models.

yolov5 and yolov8 are supported yes

abdelaziz-mahdy commented 1 year ago

please check version https://pub.dev/packages/pytorch_lite/versions/4.1.0-dev

camera code is tested on android but not tested on ios hopefully it works (will need someone to test it and report its status)

abdelaziz-mahdy commented 1 year ago

Fixed in 4.2.0