李沐深度学习softmax回归gluon

在jupyter中执行以下代码时报错“module ‘utils’ has no attribute ‘accuracy’”
from mxnet import ndarray as nd
from mxnet import autograd

for epoch in range(5):
train_loss=0.
train_acc=0.
for data,label in train_data:
with autograd.record():
output=net(data)
loss=softmax_cross_entropy(output,label)
loss.backward()
trainer.step(batch_size)

    train_loss+=nd.mean(loss).asscalar()
    train_acc+=utils.accuracy(output,label)

    
test_acc=utils.evaluate_accuracy(test_data,net)
print("Epoch %d. Loss:%f,Train acc %f,Test acc %f" % (epoch,train_loss/len(train_data),train_acc.len(train_data),test_acc))


即便在前面定义accuracy也行不通