• This project
    • Loading...
  • Sign in

2020-2-capstone-design1 / HCS_project

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • HCS_project
  • 코드
  • quantization
  • torch2onnx.py
  • 김지훈's avatar
    Add: dataset, demo / Update: train code, readme · 609480d3
    609480d3
    김지훈 authored 2020-12-06 17:03:30 +0900
torch2onnx.py 385 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import model
import torch

import importlib
importlib.reload(model)

batch_size = 256
model = model.Net().cuda().eval()
inputs = torch.randn(batch_size, 1, 29, 29, requires_grad=True).cuda()
torch_out = model(inputs)

torch.onnx.export(
    model,
    inputs,
    'bert.onnx',
    input_names=['inputs'],
    output_names=['outputs'],
    export_params=True)

print('done, onnx model')