Git Product home page Git Product logo

Comments (4)

aaronespasa avatar aaronespasa commented on July 3, 2024 2

@tzpr If this is the first time that you're installing PyTorch Live using the M1 Chip, I recommend you to install first these dependencies (before executing the npx torchlive-cli setup-dev command) executing all the commands with a Terminal that uses Rosetta:

  • The version 3.9.5 of Python and the command python3 -V must output the version 3.9.5. The command python3 is used to install the requirements and make the models. However, an specific version of torchvision requires a version of Python greater than the version 3.9.0 and smaller than the version 3.9.9 I think. In my case, the version 3.9.5 works fine.
  • The version 16 of Node (if you use the version 17 you will run into an issue).
  • Watchman: Just to brew install watchman (I don't know why this command fails each time I use the command setup-dev. So to prevent it, just install it directly using HomeBrew).
  • Android Studio and the Android SDK Manager.
  • Android Emulator -> Go to Android Studio. If the Android Emulator is not install, you can install it in System Preferences > Appearances & Behavior > System Settings > Android SDK > SDK Tools. If the Android Emulator is already installed, delete it and install it again.
  • The PyTorch Live AVD for the ARM architecture. Until the PR #24 is not accepted, I recommend you to do the following steps:

Clone my forked repository and go to the arm-emulator branch:

$ git clone https://github.com/aaronespasa/live.git
$ cd live
$ git checkout arm-emulator

Go to the torchlive-cli folder and install the Node dependencies:

$ cd torchlive-cli
$ npm install

And now, run the setup-dev command from there:

$ npm run start setup-dev

Now, all the dependencies should be correctly installed and you can init your first project and run it using the Android emulator 🎉

If you have some issues during the installation of these dependencies, just let me know and I'll help you as soon as I can!

from playtorch.

aaronespasa avatar aaronespasa commented on July 3, 2024 1

Hi @tzpr , thanks for reporting the issue!

Currently, PyTorch Live does not work with a version of OpenJDK greater than the version 8. However, the version 8 of the Java Platform has not been built natively for Apple Silicon.

I recommend you to execute the terminal using Rosetta:
- Go to the Applications folder, do right click on the Terminal app and select Get Info.
- Click on the checkbox "Open using Rosetta".

Terminal using Rosetta

By executing the terminal using Rosetta I think that you won't have any issues at the time of installing openjdk@8 using HomeBrew. I'm using a M1 MacBook and this solution works fine in my case.

Let me know if this solution works also for you!

from playtorch.

raedle avatar raedle commented on July 3, 2024

@aaronespasa, thanks a bunch for chiming in and helping out with steps and the PR #24

@tzpr, we merged PR #24. The updates are available in the nightly build of the PyTorch Live CLI. You can use the nightly by adding @nightly after the torchlive-cli. For example, the setup-dev command using the nightly looks as follows:

npx torchlive-cli@nightly setup-dev

I don't have an M1 device at hand, so I haven't tested the nightly on an M1 device myself (I requested a device today, so hopefully I'll be able to better support M1 in the near future ;)). We are also currently evaluating the option of upgrading PyTorch Live to use React Native v0.65+, which promises to fix several Apple Silicon device issues (e.g., M1/M1 Pro)

from playtorch.

tzpr avatar tzpr commented on July 3, 2024

Hi @aaronespasa, thank you for the information and help!
I just got the PyTorch Live example project (MyFirstProject) running on my Android 10 phone (rather old Nokia 6.1).

The key thing was that I started running the terminal with Rosetta. I also realized that I needed to install Homebrew using Rosetta because it installs in different location than the M1 version that I already had.
I went through all the steps listed above using Rosetta and arch -x86_64 Homebrew. One thing that is different is that my Python version is 3.9.9., couldn't find 3.9.5 from homebrew.

The setup-dev wasn't satisfied with the Android SDK Manager installation and started installing the items. It was taking some time so I ended up checking from the AndroidSDKManagerInstaller.ts file what are the items installed in that step and installed them from the terminal using the sdkmanager command. This way I was able to see what took time and how long. After that I executed the npx torchlive-cli@nightly setup-devcommand again.

I was using the nightly version of the torchlive-clilike @raedle advised, but like I said I didn't try the emulator yet, just my phone.

Thanks again for the help and quick reply @aaronespasa and @raedle .

from playtorch.

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.