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]
                      )
相关推荐
音视频牛哥1 小时前
世界模型如何重塑具身智能:从VLA到预测式机器人控制
人工智能·具身智能·世界模型·world model·vla模型·多模态感知·机器人决策
浅安的邂逅1 小时前
260902-Qwen3.8-Max-0902 登顶 Code Arena WebDev:1691 分超 Opus 5
人工智能·ai模型·行业动态·产品发布/更新·模型发布/更新
摆烂老大1 小时前
论文学习 | Expert Systems With Applications2026 | 可微分建模:S4D-HBV
python·学习·水文
力学与人工智能1 小时前
智能流体力学专题研讨会特邀报告3|边鑫:混合深度学习与迭代方法的粘性不可压流动加速求解
人工智能·深度学习·流体力学·ppt分享
顿哥GPT1 小时前
ChatGPT Plus / Pro + Codex 实战指南(2026年9月2日)
人工智能·chatgpt
mit6.8241 小时前
AI时代的定位与趋势
人工智能
深念Y1 小时前
Cloudflare Workers AI 服务部署记录
人工智能·语音识别
gsls2008081 小时前
OpsKat封装MCP:用 Go 标准库把运维 CLI 变成 AI 的“手“
运维·人工智能·golang·mcp
程序员夏洛1 小时前
谈谈你了解的最常见的几种设计模式,说说他们的应用场景
开发语言·python·模板方法模式
橙露1 小时前
Cloudflare Pages 深度评测:免费静态托管的香与坑
python·部署