minivision-ai / photo2cartoon

人像卡通化探索项目 (photo-to-cartoon translation project)
MIT License
3.94k stars 763 forks source link

export model to onnx #38

Closed ak9250 closed 3 years ago

ak9250 commented 4 years ago

what would be the steps to export this to a model.onnx file?

ak9250 commented 4 years ago

@hao-qiang do you know if the weights can be exported to onnx like here https://pytorch.org/tutorials/advanced/super_resolution_with_onnxruntime.html

ak9250 commented 4 years ago

was able to get the exported model

ak9250 commented 4 years ago

@hao-qiang do you know how to solve the mismatch issue with input output dimensions for the exported onnx model Information light : True dataset : photo2cartoon batch_size : 1 iteration per epoch : 1000000 Discriminator discriminator layer : 6 Weight adv_weight : 1 cycle_weight : 50 faceid_weight : 1 identity_weight : 10 cam_weight : 1000 rho_clipper: 1.0 w_clipper: 1.0 [*] Load models/photo2cartoon_weights.pt Success torch.Size([1, 3, 256, 256]) torch.Size([1, 2]) torch.Size([1, 1, 64, 64])

see input output size is different

ak9250 commented 4 years ago

@hao-qiang any update on this?

hao-qiang commented 3 years ago

onnx model is uploaded.