SVI step error

TypeError                                 Traceback (most recent call last)
<ipython-input-12-92001ec0b75a> in <module>()
     18 #         print(ix,batch_data.shape,data[:1])
     19 #         temp=svi.step(data[:1])
---> 20         epoch_loss += svi.step(batch_data)
     21     if j % 100 == 0:
     22         print("epoch avg loss {}".format(epoch_loss/float(N)))

~/anaconda3/envs/torch/lib/python3.5/site-packages/pyro/infer/svi.py in step(self, *args, **kwargs)
     73         # get loss and compute gradients
     74         with poutine.trace(param_only=True) as param_capture:
---> 75             loss = self.loss_and_grads(self.model, self.guide, *args, **kwargs)
     76 
     77         params = set(site["value"].unconstrained()

~/anaconda3/envs/torch/lib/python3.5/site-packages/pyro/infer/svi.py in _loss_and_grads(*args, **kwargs)
     45             if loss_and_grads is None:
     46                 def _loss_and_grads(*args, **kwargs):
---> 47                     loss_val = loss(*args, **kwargs)
     48                     loss_val.backward()
     49                     return loss_val

TypeError: 'str' object is not callable

please include your code otherwise it is difficult to debug. taking a complete shot in the dark, you probably are passing the string "TraceElbo" into SVI when it requires the TraceElbo object.

in the future please use descriptive titles for the errors and format your code output (see edits)

thanks,i use the old code

svi = SVI(model, guide, optim, loss=“ELBO”)

and i modefiy the code as # svi = SVI(model, guide, optim, loss=Trace_ELBO())
the cause is pyro version is updated.