tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

how to transfer pytorch model to caffe2 with two inputs

Open mmmmayi opened this issue 5 years ago • 1 comments

when I try to transfer my model in pytorch to caffe2, I read the official demo code: import onnx model = onnx.load("super_resolution.onnx") prepared_backend = onnx_caffe2_backend.prepare(model) W = {model.graph.input[0].name: x.data.numpy()} c2_out = prepared_backend.run(W)[0] np.testing.assert_almost_equal(torch_out.data.cpu().numpy(), c2_out, decimal=3) I know the x is the input in this example, but what should I do if I want to set two inputs? Thanks for you attention

mmmmayi avatar Jun 30 '19 12:06 mmmmayi

Hi, you need rewrite the model forword.

lxy5513 avatar Jul 13 '19 05:07 lxy5513