i want to do multi-label classification using mxnet i have found this link.
https://github.com/miraclewkf/multilabel-MXNet
i have fine tuned model using this link but i m new to mxnet so i have difficulty with how to test it.
i am using following code.
def model_load():
sym, arg_params, aux_params = mx.model.load_checkpoint('multilabelresnet50', 4)
print(arg_params)
mod = mx.mod.Module(symbol=sym)
mod.bind(for_training=False, data_shapes=[('data', (1,3,224,224))], label_shapes=[('softmax_label',(1,4))])
mod.set_params(arg_params, aux_params,allow_missing=True)
return mod
def predict(array, model):
Batch = namedtuple('Batch', ['data'])
model.forward(Batch([array]),is_train=False)
prob = model.get_outputs()[0].asnumpy()
return prob
if __name__=='__main__':
img = image.imread('b.jpg')
img = transform_eval(img)
print((img.shape))
model=model_load()
v1=predict(img,model)
print(v1)
and getting error