i am trying to export a .pth model to .pt torchscript model, i got error while doing so.
Could not export Python function call ‘Scatter’. Remove calls to Python functions before export. Did you forget to add @script or @script_method annotation? If this is a nn.ModuleList
print("=> loading checkpoint '{}'".format(args.evaluate))
checkpoint = torch.load(args.evaluate)
best_acc = checkpoint['best_acc']
best_acc = best_acc.to()
print(f'best_acc:{best_acc}')
model.load_state_dict(checkpoint['state_dict'])
print("=> loaded checkpoint '{}' (epoch {})".format(args.evaluate, checkpoint['epoch']))
rand_inp = torch.rand(1,3,224,224)
# rand_inp = rand_inp.cuda()
model.eval()
model_traced = torch.jit.trace(model, rand_inp)
model_traced.save("rab_db_poster_V2.pt")
model_traced.eval()