Coder Social home page Coder Social logo

Comments (1)

cyrillkuettel avatar cyrillkuettel commented on September 3, 2024 1

Updating Pytorch Version of the plugin

I did this a couple of months ago, so here you go:

(Disclaimer: this can be quite a hustle, it's probably easier to compile with pytorch 1.10 if that's an option that works for you.)

  1. Fork this repository to have a local copy.
  2. Open your project's pubspec.yml and update the version to the forked one.
flutter_pytorch_mobile:
    git: [email protected]:name/path-to-your-forked-repo.git

iOS

Open flutter_pytorch_mobile/ios/flutter_pytorch_mobile.podspec in your forked plugin.
Change the version you want to change, on iOS it's called LibTorch

  @ ios/flutter_pytorch_mobile.podspec:27 @ A new Flutter plugin project.
  s.static_framework = true
  s.public_header_files = 'Classes/**/*.h'

-  s.dependency 'LibTorch', '~>1.10.0'
+  s.dependency 'LibTorch', '~>1.13.0'
    # Flutter.framework does not contain a i386 slice.
  s.pod_target_xcconfig = { 'DEFINES_MODULE' =>

Here we've changed the dependency s.dependency 'LibTorch to 1.13 as an example.
❗ You'll to check which version you need that works with PyTorch 2.0.0

After that, run

pod update LibTorch

for the changes to take effect (If you don't have pod, you need to install Cocabods)

Maybe you also need:

flutter build ios

Android

On android, pytorch mobile is specified as a gradle dependency in your forked plugin.
Open flutter_pytorch_mobile/android/build.gradle

dependencies {
    implementation 'org.pytorch:pytorch_android:1.13.1'
    implementation 'org.pytorch:pytorch_android_torchvision:1.13.1
}

After that, sync gradle and make sure everything works in the Android build. It usually helps opening Android Studio and resolving all issues.
Finally, don't forget to commit and push your changes.

from flutter_pytorch_mobile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.