Last active
August 14, 2021 09:32
-
-
Save rongtuech/2c0b7d500403f5a82560ad547f130941 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import torch | |
from tgcn_model import GCN_muti_att | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-w', '--weight', type=str, required=True) | |
parser.add_argument("-o", '--output_name', type=str, required=True) | |
args = parser.parse_args() | |
num_classes =100 | |
net = GCN_muti_att(input_feature=50 * 2, hidden_feature=64, | |
num_class=num_classes, p_dropout=0.3, num_stage=20) | |
net.load_state_dict(torch.load(args.weight)) | |
input = torch.randn(1, 55, 50 * 2) | |
input_names = ['data'] | |
output_names = ['output'] | |
torch.onnx.export(net, input, args.output_name, | |
verbose=True, | |
input_names=input_names, | |
output_names=output_names) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy this code to PoseTGN folder in WLASL to export onnx from pretrained pytorch model.