how to convert model to torchscript?
import sys sys.path.insert(1,'/root/Downloads/ParallelWaveGAN-0.5.3/parallel_wavegan/utils') import torch import utils module = utils.load_model('pretrained_model/checkpoint-400000steps.pkl') print(module) #model = torch.load('pretrained_model/checkpoint-400000steps.pkl',map_location=torch.device('cpu')) #print('load model successful!') x = torch.zeros(5, 10, 5, dtype=torch.float64) x = x + (0.1**0.5)*torch.randn(5, 10, 5) c = torch.rand(80,80,5) print(x) print('-------------------') print(c) print('-------------------') print(x.size(-1)) print('-------------------') print(c.size(-1)) trace_model = torch.jit.trace(module,(x,c))
error is :
Traceback (most recent call last):
File "demo.py", line 19, in
how to set parametr x and c value?