Open NiklasGustafsson opened 3 years ago
an example for loading and running torchscript models for mobile android/ios inference would be great
@imjwang, do you mean a model that has been built using Pytorch and TorchScript, loaded with .NET, or do you mean training and producing the model using .NET, then exporting to native code via TorchScript?
the former, a pretrained model that has already been exported to .ts or .pt
import spacy
import torchtext
import pandas as pd
import torch.nn as nn
import torch.optim as optim
from torchtext.legacy import data
import IPython.display as display
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import random
import torch
import torchaudio
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from pathlib import Path
from PIL import Image
from torch.utils.data import Dataset
from torchvision import models, transforms
import torch
import torch.nn as nn
import torch.utils.data
import torchvision
from functools import partial
from torch import optim
from torch.utils.tensorboard import SummaryWriter
from torchvision import datasets, transforms
I have Pytorch experience, but am completely new to Xamarin, C#, and .NET eg. I'm still trying to figure out how to correctly import Torchsharp to a Xamarin cross-platform mobile project after installing the nuget package. So any basic Xamarin and C# examples like what @GeorgeS2019 suggested would help tremendously.
Thank you in advance.
https://github.com/rognarspb/TorchClassifier https://github.com/MIAIONE/TorchSharpTest https://github.com/mlnethub/SegFormer-Segnext-torchsharp/ https://github.com/lijianxin520/torchsharp_baselib https://github.com/rognarspb/TorchClassifier/ https://github.com/ds5678/TorchCategorizationDemo
I received these suggestions from @GeorgeS2019 via email:
https://github.com/Apress/pytorch-recipes
https://github.com/Apress/pytorch-recipes/blob/master/Torch_AI_7.ipynb
Has a few NLP examples to “complete” your torchsharp examples • 7.1 Word Embedding • 7.2 Continuous bag of words (CBOW) • 7.3 LSTM Model