Git Product home page Git Product logo

Comments (7)

raedle avatar raedle commented on July 23, 2024 1

@RyanShun-511 to help narrow down the issue, please provide a list of model files (i.e., *.ptl files) that are generated when following the steps provided in my comment above

Thank you!

from playtorch.

raedle avatar raedle commented on July 23, 2024

@RyanShun-511 , thanks for reporting this issue. We were able to reproduce it on our end and will submit a fix soon!

In the meantime, you can try if the follow steps unblock you:

  1. cd F:\PyTorchDemo\MyFirstProject\models
  2. Change line 27 in make_models.py from spec = Path(f"{name}.{MODEL_EXTENSION}.live.spec.json").read_text() to spec = Path(f"{name}.{MODEL_EXTENSION}.live.spec.json").read_text(encoding="UTF-8")
  3. python3 -m venv venv
  4. .\venv\Scripts\activate
  5. pip install -r requirements.txt
  6. python make_models.py

The steps above export the ptl models. Re-run the npx react-native run-android to build and deploy the app in the emulator or a physical device.

from playtorch.

RyanShun-511 avatar RyanShun-511 commented on July 23, 2024

@raedle Thank you for your reply. Following your steps, I can see the model generated in the export_image_Classification_models function under F:\PyTorchDemo\MyFirstProject\ Models. The detr_resnet50.ptl file does not exist. Later parts of the program, such as MNIST models, may not be generated.
Excuse me, how can I solve this problem?

Description on node:
error: Error: Unable to resolve module ../../models/detr_resnet50.ptl from F:\PyTorchDemo\MyFirstProject\src\examples\ObjectDetectionExample.tsx:

None of these files exist:

  • detr_resnet50.ptl
  • models\detr_resnet50.ptl\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
    25 | const modelInfo: ModelInfo = {
    26 | name: 'DETR',

27 | model: require('../../models/detr_resnet50.ptl'),
| ^
28 | };
29 |
30 | const objectColors = [
at ModuleResolver.resolveDependency (F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:211:15)
at DependencyGraph.resolveDependency (F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\node-haste\DependencyGraph.js:413:43)
at Object.resolve (F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\lib\transformHelpers.js:317:42)
at resolve (F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:629:33)
at F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:645:26
at Array.reduce ()
at resolveDependencies (F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:644:33)
at F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:329:33
at Generator.next ()
at asyncGeneratorStep (F:\PyTorchDemo\MyFirstProject\node_modules\metro\src\DeltaBundler\traverseDependencies.js:137:24)

from playtorch.

RyanShun-511 avatar RyanShun-511 commented on July 23, 2024

@raedle Or you have the detr_resnet50.ptl model file and the model files generated in the export_mnist_model and export_NLP_models functions for me to download. I put it directly in the F:\PyTorchDemo\MyFirstProject\ Models folder.
Thank you for your careful answer.

from playtorch.

RyanShun-511 avatar RyanShun-511 commented on July 23, 2024

During the execution of the make_model.py file, I downloaded the model from the URL myself. You can put the program on your phone. Thank you for your answers.

from playtorch.

azhugreat avatar azhugreat commented on July 23, 2024

@raedle I have faced this problem myself, and I have generated these files.
The following are the generated files:
image

The file size are 353MB, so I wonder whether I should upload them to you there.

from playtorch.

raedle avatar raedle commented on July 23, 2024

The models are no longer part of the template, and with the new PlayTorch API and the PlayTorch app + Snack there are now better alternatives to experiment with on-device ML models.

Closing this issue due to inactivity. Please reopen if this is still ongoing!

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.