I have just realized that, actually, using torch.nn.Parameter makes the VHP 0 again (and with strict=True an exception is raised.
The problem is solved if I load the params with torch.nn.Parameter after the computation.
So I changed load_weights to
def load_weights(model, names, params, as_params=False):
    for name, p in zip(names, params):
        if not as_params:
            set_attr(model, name.split("."), p)
        else:
            set_attr(model, name.split("."), torch.nn.Parameter(p))

And I call
load_weights(model, names, params, as_params=True)

I have just read your answer, though, and I guess this would be wrong too, right?
Do you have any suggestion to have back the nn model after making it functional?
Thanks!