YYuanAnyVision / mxnet_center_loss

implement center loss operator for mxnet
193 stars 93 forks source link

train error: mx.symbol.Custom type error #8

Closed smartadpole closed 6 years ago

smartadpole commented 6 years ago

运行train.py 报错:

TypeError: init() got an unexpected keyword argument 'data'

报错代码行

center_loss_ = mx.symbol.Custom(
        data=net, label=center_label, name='center_loss_', op_type='centerloss',
        num_class=NUM_CLASS, alpha=0.5, scale=1.0, batchsize=batch_size)

报错信息 image

smartadpole commented 6 years ago

解决了

net_mxnet = mv2.get_symbol(NUM_CLASS, 1)
net = gluon.nn.SymbolBlock(outputs=net_mxnet, inputs=mx.sym.var('data'))

wrong: data = net in centerloss right: data = net_mxnet in centerloss data 不能接收 gloun类型的输出

我自己改过程序