Comments (6)
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.
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?
- when you "npx torchlive-cli init [project name]", do you see any error reported?
- 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?
- could you also try to run "npx torchlive-cli run-android" within the "[project name]/" directory?
from playtorch.
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
- That's what I did!
from playtorch.
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).
- Install all the necessary dependencies and packages:
$ npx torchlive-cli setup-dev
- Install Android Studio.
- 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
-
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 themodels/
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
- 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
-
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.
- Run the torchlive-cli command:
The app should look like this at the beginning (and in the pointed section you can start to do your own projects ๐งช):
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.
@tnoulas, does this issue still exist in the latest release 0.2.0
?
from playtorch.
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)
- PlayTorchJSIModule not found - ios & android m2 macbook pro HOT 2
- It is not possible to convert audio float32 tensor to playable uint8 audio expected by .audioFromBytes() HOT 1
- How to specify interpolation in transforms.resize?
- AudioUtil is not working on Android
- How to convert my yolov5s.pt to yolov5s.ptl HOT 1
- resize function gives error: 'Factory function resize expects 1 argument but 4 are given.'
- Cannot scan QR code from the PlayTorch app HOT 2
- playtorchjsimodule not found
- Mac M1 tutorial failure HOT 2
- unable to load local .ptl model HOT 2
- How to export a Huggingface transfromer model? HOT 3
- react_native_pytorch_core error during gradle build HOT 15
- image data fetch
- Is there a processing step im missing when using a custom trained yolo model?
- Is this project still maintained?
- Unable to work
- CMake Error
- Android build fails | Expo app using prebuild HOT 4
- 'react_native_pytorch_core-Swift.h' file not found during ios build HOT 1
- Add how to use EAS (Expo Application Service) build within this tutorial
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playtorch.