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]
                      )
相关推荐
芷栀夏4 小时前
CANN ops-math:异构计算场景下基础数学算子的深度优化与硬件亲和设计解析
人工智能·cann
爱吃泡芙的小白白4 小时前
深入解析CNN中的BN层:从稳定训练到前沿演进
人工智能·神经网络·cnn·梯度爆炸·bn·稳定模型
聆风吟º4 小时前
CANN runtime 性能优化:异构计算下运行时组件的效率提升与资源利用策略
人工智能·深度学习·神经网络·cann
不写bug的程序媛4 小时前
n8n用veo3生成视频一直报错获取不到图片链接问题
人工智能
一山秋叶4 小时前
带分数正则的一致性蒸馏
人工智能·深度学习
一枕眠秋雨>o<4 小时前
算子即战略:CANN ops-nn 如何重构大模型推理的内存与计算边界
人工智能·重构
网安墨雨4 小时前
Python自动化一------pytes与allure结合生成测试报告
开发语言·自动化测试·软件测试·python·职场和发展·自动化
hg01184 小时前
威海挖掘机开年斩获2亿元非洲订单
人工智能
lusasky4 小时前
海事监管数据挖掘技术栈
人工智能·数据挖掘
忆~遂愿4 小时前
Runtime 上下文管理:计算实例的生命周期、延迟最小化与上下文切换优化
java·大数据·开发语言·人工智能·docker