U2-net model for Pytorch Live #70
Comments
EDIT: It was an error on my end. The Ignore message below for now :) Hi @lavandaboy, I tried loading the model as lite interpreter model in a Google Colab, but get a ---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
[<ipython-input-4-86c4d700d487>](https://localhost:8080/#) in <module>()
1 from torch.jit.mobile import _load_for_lite_interpreter
2
----> 3 model = _load_for_lite_interpreter('/content/u2netp_small_live.ptl')
4
5 print(model)
[/usr/local/lib/python3.7/dist-packages/torch/jit/mobile/__init__.py](https://localhost:8080/#) in _load_for_lite_interpreter(f, map_location)
46
47 if isinstance(f, str) or isinstance(f, pathlib.Path):
---> 48 cpp_module = torch._C._load_for_lite_interpreter(f, map_location)
49 else:
50 cpp_module = torch._C._load_for_lite_interpreter_from_buffer(f.read(), map_location)
RuntimeError: Format error Can you provide the steps how you exported the model and saved it for the lite interpreter runtime (e.g., as a Google Colab)? Ideal would be if you could provide an example in the Google Colab how to use the model.
Happy to give it a try if you can provide additional info as mentioned above 🙂 |
Hey @lavandaboy, I was able to use your exported model and build a simple on-device demo with PyTorch Live. You can find the code in the following repo: https://github.com/raedle/UNetExample Can you provide instructions here or as a PR on the repo how you exported the model for PyTorch Mobile lite interpreter? That would be rad! Thank you! |
Hi Roman, As always, thanks a lot for your help! The conversion manual is the following:
Hope this manual helps to convert more models to Pytorch Live! Now I will play with your working example :) Thanks, Roman! |
Tutorial Select
Prepare Custom Model
Feedback
Hi Pytorch Live community,
I am trying to implement the (U2-net model) instead of AnimeGan model which is provided as an example to test how it works with Pytorch Live. The steps I do:
As the result, nothing happens ("Processing..." is )I receive the following error: Possible Unhandled Promise Rejection (id:0): Object { "message": " ",}
Could you please advise how to implement the U2-net model into Pytorch Live? If you need anything else to provide from me please let me know.
Thanks!
The text was updated successfully, but these errors were encountered: