crnn-audio-classification icon indicating copy to clipboard operation
crnn-audio-classification copied to clipboard

how to transfowm the model file to Torchscript

Open jokerpp opened this issue 5 years ago • 1 comments

hello , i wonder if i can know how to transfowm the model file to Torchscript , so i can call the function by C++ .
i looked up a lot of information , but what i found is too simple case .

for example: model = torchvision.models.resnet18() example = torch.rand(1, 3, 224, 224) traced_script_module = torch.jit.trace(model, example)

or like this: my_module = MyModule(10,20) sm = torch.jit.script(my_module)

but that is not suit for us , i can't transform model like that , so ,can you help me with this problem

jokerpp avatar Apr 08 '20 01:04 jokerpp

Hey @jokerpp. I think ideally I want to move the repo to use torchaudio instead of torhaudio_contrib. Are you getting any specific error when you try to script the module?

ksanjeevan avatar Apr 29 '20 21:04 ksanjeevan