Unable to do next(model.parameters()) with Pyro models

In Pyro the guide represents an approximate posterior distribution. Each call of guide() samples values from the approximate posterior. When you initial create guide = AutoNormal(model) the guide parameters are nonsense; you’ll need to first train the guide (fit it to data) using variational inference. See the variational inference tutorial for more detailed explanation.