Git Product home page Git Product logo

Comments (6)

raedle avatar raedle commented on July 23, 2024 1

Hi @tnoulas,

If I understand correctly, the Image Classification tutorial worked for you, but running the commands in the Get Started tutorial fails. Is this correct?

Can you provide the output for the following commands:

  • npx torchlive-cli doctor
  • npx react-native info

It might be a shot in the dark, but try running npx torchlive-cli clean in the project directory and then re-run npx torchlive-cli run-android. It could be that there are some artifacts from previous Android builds that are causing an issue

from playtorch.

liuyinglao avatar liuyinglao commented on July 23, 2024

Hey @tnoulas,

Thanks for reporting the issue! The build error message doesn't seems to be clear where may go wrong -- may I ask for your help to identify the issue with the following check?

  1. when you "npx torchlive-cli init [project name]", do you see any error reported?
  2. could you run in your terminal "ls [project name]/models" and paste the output here so that we can verify if all models are generated correctly?
  3. could you also try to run "npx torchlive-cli run-android" within the "[project name]/" directory?

from playtorch.

tnoulas avatar tnoulas commented on July 23, 2024

Hi,

the above happened only when I used the MyFirstProject instructions.

When instead I try to run this tutorial https://pytorch.org/live/docs/tutorials/image-classification
it all worked great!

Back to your questions

(base) AnastasiossMBP2:MyFirstProject anastasiosnoulas$ ls ./models/
bert_qa.ptl mnist.ptl requirements.txt
bert_qa.ptl.live.spec.json mnist.ptl.live.spec.json resnet18.ptl
detr_resnet50.ptl mobilenet_v3_large.ptl resnet18.ptl.live.spec.json
detr_resnet50.ptl.live.spec.json mobilenet_v3_large.ptl.live.spec.json venv
error.log mobilenet_v3_small.ptl
make_models.py mobilenet_v3_small.ptl.live.spec.json

  1. That's what I did!

from playtorch.

aaronespasa avatar aaronespasa commented on July 23, 2024

Hey @tnoulas,

Did you install all the dependencies and packages before executing the init command? If that's not the case, I encourage you to run the following command:

$ npx torchlive-cli setup-dev

You'll see that the previous command will also install both the Android SDK and the Android Emulator. But even when I did this, I still couldn't run the app on the Android Emulator. What was missing was to install Android Studio.

After you have executed the setup-dev command, install Android Studio: Click on this link to go to the official webpage of Android Studio.


I'll summarize the steps you have to follow:

    • Make sure you have Ruby updated and added to PATH. Otherwise, CocoaPods will throw some errors (Install Ruby on Your Mac).
    • I also think that the version 17 of Node have some conflicts, so downgrade Node to the version 16 (StackOverflow - How to downgrade Node version).
    • The last thing of this step, upgrade Python to the version 3.9.9 and make sure the command python3 -V outputs Python 3.9.9 (Once this pull request is approved you will no longer have to worry about the python version).
  1. Install all the necessary dependencies and packages:
$ npx torchlive-cli setup-dev
  1. Install Android Studio.
  2. Now, you're ready to create the template for your project (remember, python3 -V has to output the version 3.9.9):
$ npx torchlive-cli init TheNameOfMyProject
  1. Now you're all set up! ๐ŸŽ‰

    • However, make sure the models in the TheNameOfMyProject/models/ folder have been built correctly (check that there are files that end with the extensiรณn .ptl). Otherwise, you'll have to build them yourself. In this last case, run the following commands inside the models/ folder:
    • Activate the environment: source venv/bin/activate).
    • Install the necessary dependencies: python3 -m pip install requirements.txt --no-cache-dir.
    • Build the models: python3 -W ignore make_models.py
  2. To run your app in Android, go to the TheNameOfMyProject/ main folder. There you have 2 options:

    • Run the torchlive-cli command: $ npx torchlive-cli run-android.
    • If the terminal gets stuck in the execution, stop the command. Open two different terminal and execute this command $ npx react-native start in one terminal (this will open metro and will look for changes in your code to be applied in your app in real-time) and this other command $ npx react-native run-android to build the app on the Android emulator or on your phone.

The app should look like this at the beginning (and in the pointed section you can start to do your own projects ๐Ÿงช):

image

I'm trying to make this project available for the M1 MacBooks and solving the problems stated in the 0. section. Let me know if you've any issue with any of the previous steps, I'll be happy to help you! ๐Ÿ˜Š

from playtorch.

raedle avatar raedle commented on July 23, 2024

@tnoulas, does this issue still exist in the latest release 0.2.0?

from playtorch.

chrisklaiber avatar chrisklaiber commented on July 23, 2024

Closing this issue since it has been quiet for a long time. If you still need assistance, please feel free to reopen.

Since this was filed, we've released the PlayTorch app to make it easier to get started without a local development environment. Follow these instructions to get going: https://playtorch.dev/docs/tutorials/get-started/

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.