在paddleslim 图像分类模型知识蒸馏-快速开始 教程中 运行的问题?
Created by: Sejudyblues
model = slim.models.dict'MobileNet' student_program = fluid.Program() student_startup = fluid.Program() with fluid.program_guard(student_program, student_startup): image = fluid.data( name='image', shape=[None] + [1, 28, 28], dtype='float32') label = fluid.data(name='label', shape=[None, 1], dtype='int64') out = model.net(input=image, class_dim=10) cost = fluid.layers.cross_entropy(input=out, label=label) avg_cost = fluid.layers.mean(x=cost) acc_top1 = fluid.layers.accuracy(input=out, label=label, k=1) acc_top5 = fluid.layers.accuracy(input=out, label=label, k=5)
当运行到这里时候 提示错误如下: ---------------------------------------------------------------------------NameError Traceback (most recent call last) in ----> 1 model = models.dict'MobileNet' 2 student_program = fluid.Program() 3 student_startup = fluid.Program() 4 with fluid.program_guard(student_program, student_startup): 5 image = fluid.data( NameError: name 'models' is not defined
说model没有定义 我看这个教程最开始也只是导入 import paddle import paddle.fluid as fluid import paddleslim as slim 这三个锕 这是什么原因呢?望解答