mxnet错误解决Parameter ‘dense3_weight’ has not been initialized. Note that you should initialize parameters and create Trainer with Block.collect_params() instead of Block.params because the later does not include Parameters of nested child Blocks

mxnet错误如下

Parameter ‘dense3_weight’ has not been initialized. Note that you should initialize parameters and create Trainer with Block.collect_params() instead of Block.params because the later does not include Parameters of nested child Blocks


net=nn.Dense(100, activation="relu")

# 使用默认方式初始化即可
net.initialize()

net(output)