1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AnimeGAN2をエクスポートします

68747470733a2f2f63616d6f2e716969746175736572636f6e74656e742e636f6d2f373461303262366530623830653532633261653361663739386339336565613961613365333934642f363837343734373037333361326632663731363936393734363132643639366436313637363532643733373436.png

68747470733a2f2f63616d6f2e716969746175736572636f6e74656e742e636f6d2f333131333439646134373133366666396365363137303164303963653539646336363363393562662f363837343734373037333361326632663731363936393734363132643639366436313637363532643733373436.png

手順

import torch

# Get the model from torch hub.

model = torch.hub.load("bryandlee/animegan2-pytorch:main", "generator", pretrained="face_paint_512_v1").eval()

# Convert.

dummy_input = torch.randn(1, 3, 512, 512)

input_names = [ "input" ]
output_names = [ "var_444" ]

torch.onnx.export(model, dummy_input, "animegan2_face_paint_512_v1.onnx", verbose=True, input_names=input_names, output_names=output_names, opset_version=11) 
## Specify opset_version for upsampling layer.

🐣


フリーランスエンジニアです。
お仕事のご相談こちらまで
rockyshikoku@gmail.com

Core MLやARKitを使ったアプリを作っています。
機械学習/AR関連の情報を発信しています。

Twitter
Medium
GitHub

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?