What is the reason of this error

for epoch in range(2): #loop over the dataset multiple times
running_loss = 0.0
for i,data in enumerate(trainloader , 0):
inputs , labels = data
optimizer.zero_grad()
outputs = net(inputs)
loss = criterion(outputs, labels)
loss.backward()
optimizer.step()

TypeError Traceback (most recent call last)
in ()
3 for i,data in enumerate(trainloader , 0):
4 inputs , labels = data
----> 5 optimizer.zero_grad()
6 outputs = net(inputs)
7 loss = criterion(outputs, labels)

TypeError: ‘list’ object is not callable

Did you replace the zero_grad method with a list object before?
If not, could you post an executable code snippet, so that we could have a look at this issue?

PS: you can post code snippets by wrapping them into three backticks ``` :wink: