tutorials
tutorials copied to clipboard
how to transfer pytorch model to caffe2 with two inputs
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
Hi, you need rewrite the model forword.