使用MindSpore查看模型参数

 时间:2026-04-30 10:52:35

1、可以直接加载CheckPoint统计,可能额外统计了动量和optimizer中的变量,需要过滤下相关变量。 可以参考如下接口统计网络参数量。

def count_params(net):

    """Count number of parameters in the network

    Args:

        net (mindspore.nn.Cell): Mindspore network instance

    Returns:

        total_params (int): Total number of trainable params

    """

    total_params = 0

    for param in net.trainable_params():

        total_params += np.prod(param.shape)

    return total_params

  • UltraEdit怎么设置打印时文本自动换行
  • 波尔多酒区六大酒庄
  • 离婚后如何调整心态
  • 在职场如何进行自我激励?
  • IOS版Pillow如何授权麦克风?
  • 热门搜索
    手机开机密码忘了怎么办 酥肉怎么做好吃 出虚汗是怎么回事 的繁体字怎么写 手指脱皮是怎么回事 教学内容怎么写 鸡内金怎么吃 手脚发热是怎么回事 红血丝怎么消除 碧螺春怎么泡