深度阅读

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

作者
作者
2023年08月22日
更新时间
4.92 分钟
阅读时间
0
阅读量

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)

核心原因就是因为没有初始化参数

参考
https://mxnet.apache.org/versions/1.6/api/python/docs/tutorials/getting-started/crash-course/2-nn.html

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。