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]
                      )
相关推荐
陆通21 分钟前
10分钟Windows系统安装迷你版的OpenClaw ,小小龙虾Nanobot
人工智能
老张的码21 分钟前
飞书 × OpenClaw 接入指南
人工智能·后端
mCell25 分钟前
分享一个常用的文生图提示词
人工智能·llm·数据可视化
踩着两条虫26 分钟前
如何让AI精准修改你的Vue代码?揭秘增量更新器实现原理
人工智能·openai·ai编程
ZFSS32 分钟前
SeeDance Tasks API 的对接和使用
前端·人工智能
睿智的仓鼠33 分钟前
🦞OpenClaw 快速部署及使用指南
前端·人工智能
zone773934 分钟前
004:RAG 入门-LangChain读取PDF
后端·python·面试
zone773939 分钟前
005:RAG 入门-LangChain读取表格数据
后端·python·agent
jerrywus1 小时前
为什么每个程序员都应该试试 cmux:AI 加持的终端效率革命
前端·人工智能·claude