0

I am a beginner at using TVM. I have traced the resnet50. Now, I want to get the optimized modules using: model = ResNet50(10, 3) model.to(dtype)

trace_input = torch.rand(1, 3, 224, 224)
traced_model = torch.jit.trace(model, trace_input)
for p in traced_model.parameters():
    p.requires_grad_(False)

shape_list = [(i.debugName().split('.')[0], i.type().sizes()) 
    for i in  list(traced_model.graph.inputs())[1:]]
mod, mod_params = tvm.relay.frontend.from_pytorch(traced_model, shape_list, default_dtype=dtype_str)
mod_optimized, mod_params_optimized = tvm.relay.optimize(mod, target, params=mod_params)

However, the length of the mode_params_optimized dictionary is zero. I would appreciate it if anyone could suggest to me how to find the problem.

Maryam
  • 119
  • 1
  • 1
  • 6
  • Helpful: https://discuss.tvm.apache.org/t/why-are-the-output-parameters-of-tvm-relay-optimize-empty/13892/2?u=maryam – Maryam Nov 09 '22 at 16:32

0 Answers0