-
Notifications
You must be signed in to change notification settings - Fork 191
Demo app updates for Lite Interpreter: scripts, iOS code, and README #67
Conversation
| If you don't have the PyTorch environment set up to run the script below to generate the model file, you can download it to the `ios-demo-app/ImageSegmentation` folder using the link [here](https://drive.google.com/file/d/1FHV9tN6-e3EWUgM_K3YvDoRLPBj7NHXO/view?usp=sharing). | ||
| If you don't have the PyTorch environment set up to run the script below to generate the model file, you can download it to the `ios-demo-app/ImageSegmentation` folder using the link [here](https://drive.google.com/file/d/1_guNVutt8eTvO_YhGxkAe1uReBhNaC4f/view?usp=sharing). | ||
|
|
||
| Be aware that the downloadable model file was created with PyTorch 1.7.0, matching the iOS LibTorch library 1.7.0 specified in the `Podfile`. If you use a different version of PyTorch to create your model by following the instructions below, make sure you specify the same iOS LibTorch version in the `Podfile` to avoid possible errors caused by the version mismatch. Furthermore, if you want to use the latest prototype features in the PyTorch master branch to create the model, follow the steps at [Building PyTorch iOS Libraries from Source](https://pytorch.org/mobile/ios/#build-pytorch-ios-libraries-from-source) on how to use the model in iOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update all the recipes as well or add new set for lite interpreter specific recipes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, as all PT Mobile recipes have this:
Pre-requisites
PyTorch 1.6.0 or 1.7.0
torchvision 0.6.0 or 0.7.0
So do the tutorials https://pytorch.org/tutorials/beginner/deeplabv3_on_ios.html and https://pytorch.org/tutorials/beginner/deeplabv3_on_android.html
| torch::autograd::AutoGradMode guard(false); | ||
| at::AutoNonVariableTypeMode non_var_type_mode(true); | ||
|
|
||
| c10::InferenceMode guard; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the guard getting used?
|
Thanks @jeffxtang ! This looks great. Have you updated all objective-c wrappers to use |
Just double checked and found I updated 7 of 8, except D2Go - let me do it now. |
|
As far as I know downloads.pytorch.org doesn't host model weights but @seemethere can correct me if I'm wrong The way I've seen models hosted if they come from Facebook is via Torch Hub. You can follow instructions from their README here https://github.com/pytorch/hub After doing this users can use your model weights with something like
Another alternative is you host all your trained models on an S3 bucket and you can give it a nice name like pytorch-lite-models and people would just wget the S3 url. This is what we do with Torchserve. If you'd like to feature the model on the pytorch.org website you can look at uploading it here https://github.com/pytorch/pytorch.github.io |
No description provided.