Did you pass in the weight param when you create the relay model? The IR should look like nn.conv2d(%data, meta[relay.Constant][0] where the weight is a constant
model = LeNet().to(device=device).eval()
example = torch.randn(1,1,28,28)
traced_module = torch.jit.trace(model, example).eval()
shape_list = [(i.debugName().split('.')[0], i.type().sizes()) for i in list(traced_module.graph.inputs())[1:]]
mod, params = tvm.relay.frontend.from_pytorch(traced_module, shape_list)
@vinx13 Sorry… I can’t get the point. What do u mean load params when create model in pytorch? Doesn’t it already has its own weight when I create the model?
I can print it out by :
for name, param in model.named_parameters():
print(f"Layer: {name} | Size: {param.size()} | Values : {param[:2]} \n")