I found my error. In case anybody else encounters this, the error stems from the model:
def model(self, data, nb_emails):
weight = pyro.sample("weight", dist.Normal(tensor([0.]), tensor([1.])))
with pyro.plate("emails", nb_emails):
feature = torch.tensor([0.3])
featureValue = pyro.sample("feature", dist.Normal(.4, 1), obs=data)
score = weight * featureValue
#score = pyro.sample("score", dist.Normal(0., weight), obs=score)
score = pyro.sample("score", dist.Delta(score), obs=score)
The score is a deterministic function (multiplication) of weight and featureValue. I sampled score with a Normal distribution, which was inconsistent with the deterministic function. Once I sample a Delta distribution, everything worked in the sense that losses were no longer infinite. I also added an obs argument since the score derives from a deterministic formula.
I do have a question: is adding the "obs" argument the correct approach? Could somebody give me an example of using a Delta distribution that does not involve an observation? Thanks.