tensorflow 2.16.1 can not use save and load

already use model.save(). not use the load weight. the question is : self.b1 = BatchNormalization(), in my code, the BatchNormalization(), do not take any parameter, why Layer 'batch_normalization_20' expected 4 variables?

Sent by you: already use model.save(). not use the load weight. the question is : self.b1 = BatchNormalization(), in my code, the BatchNormalization(), do not take any parameter, why Layer 'batch_normalization_20' expected 4 variables?

change to 2.15.0 , it is ok. but a lot of change on

复制代码
model_res_net.compile(optimizer=optimizer,
                      # loss=[tf.keras.losses.CategoricalCrossentropy(from_logits=False)] * 4,
                      # # metrics=['categorical_accuracy'] * 4,
                      # metrics=[tf.keras.metrics.CategoricalAccuracy(name='categorical_accuracy'),
                      #          tf.keras.metrics.CategoricalAccuracy(name='categorical_accuracy_1'),
                      #          tf.keras.metrics.CategoricalAccuracy(name='categorical_accuracy_2'),
                      #          tf.keras.metrics.CategoricalAccuracy(name='categorical_accuracy_3')],
                      loss={'output_1': tf.keras.losses.CategoricalCrossentropy(from_logits=False),
                            'output_2': tf.keras.losses.CategoricalCrossentropy(from_logits=False),
                            'output_3': tf.keras.losses.CategoricalCrossentropy(from_logits=False),
                            'output_4': tf.keras.losses.CategoricalCrossentropy(from_logits=False)},
                      metrics={
                          'output_1': tf.keras.metrics.CategoricalAccuracy(name='acc'),
                          'output_2': tf.keras.metrics.CategoricalAccuracy(name='acc'),
                          'output_3': tf.keras.metrics.CategoricalAccuracy(name='acc'),
                          'output_4': tf.keras.metrics.CategoricalAccuracy(name='acc')},
                      loss_weights=[1.0, 1.0, 1.0, 1.0]
                      )
相关推荐
lijianhua_97127 小时前
国内某顶级大学内部用的ai自动生成论文的提示词
人工智能
蔡俊锋7 小时前
用AI实现乐高式大型可插拔系统的技术方案
人工智能·ai工程·ai原子能力·ai乐高工程
自然语7 小时前
人工智能之数字生命 认知架构白皮书 第7章
人工智能·架构
大熊背7 小时前
利用ISP离线模式进行分块LSC校正的方法
人工智能·算法·机器学习
eastyuxiao8 小时前
如何在不同的机器上运行多个OpenClaw实例?
人工智能·git·架构·github·php
诸葛务农8 小时前
AGI 主要技术路径及核心技术:归一融合及未来之路5
大数据·人工智能
光影少年8 小时前
AI Agent智能体开发
人工智能·aigc·ai编程
极梦网络无忧8 小时前
OpenClaw 基础使用说明(中文版)
python
codeJinger8 小时前
【Python】操作Excel文件
python·excel
ai生成式引擎优化技术8 小时前
TSPR-WEB-LLM-HIC (TWLH四元结构)AI生成式引擎(GEO)技术白皮书
人工智能