tensorflow 2.16.1 can not use save and load

这篇具有很好参考价值的文章主要介绍了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 文章来源地址https://www.toymoban.com/news/detail-858296.html

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]
                      )

到了这里,关于tensorflow 2.16.1 can not use save and load的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • VM报错Before you can run VMware several modules must be compiled and loaded into the running kernel

    Ubuntu 20.04下启动虚拟机 VMware 时,报错: Before you can run VMware several modules must be compiled and loaded into the running kernel . 按提示点击 install 无法解决。 1 下载 vmware-host-modules 并切换到对应分支 这里如果直接执行 sudo make sudo make install 会报以下错误: 2. 编辑 vm_asm_x86.h 编辑 vmware-host

    2024年02月11日
    浏览(41)
  • Vue报错was preloaded using link preload but not used within a few seconds from the window‘s load

    在vue小程序开发的时候报了一个不知所以的错误,后来发现是因为注释的问题,这解析太严谨了  报错信息如下:  报错代码: 修改后代码,把注释取消即可:

    2024年02月12日
    浏览(34)
  • 爬虫requests使用代理报错Your proxy appears to only use HTTP and not HTTPS...

    python版本:3.9.4 requests版本:2.28.2 详细报错如下 代理使用如下: 使用如下代理设置,报错得到解决 总结:由于之前使用的是python3.6.8版本,代理设置为’https’: \\\'https://xxxx’可以正常使用,而升级到python3.9.4则出现了上述问题。建议代理的使用统一为 ‘https’: ‘http://xxxx’

    2024年02月15日
    浏览(48)
  • whisper报错:UserWarning: FP16 is not supported on CPU; using FP32 instead

    报错: 这个报错说的是whisper要使用cpu,而你音频是fp16的,cpu不支持。 要点在于如何解决为什么whisper没使用GPU 应该是搞别的时候把torch给搞成cpu版本的了。 按照这个方式在装一下就好了 https://pytorch.org/

    2024年02月16日
    浏览(36)
  • 已解决W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘c

    已解决W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘cudart64_110.dll’; dlerror: cudart64_110.dll not found I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. import tensorflow.contrib.layers as layers ModuleNotFoundError: No

    2024年01月21日
    浏览(42)
  • ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directl

    安装yolov5依赖库时,最后pycocotools报错 重点是以下原因: error: Microsoft Visual C++ 14.0 or greater is required. Get it with \\\"Microsoft C++ Build Tools\\\": https://visualstudio.microsoft.com/visual-cpp-build-tools/ 尝试的解决方法如下: 1、直接下载VS2022中,工作负荷里有关C++和Python的(未成功) 结果报错 vs2

    2024年02月02日
    浏览(37)
  • Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

    当我们运行代码要运用到cv2库时,提示我们没有安装cv2,而直接用pip install opencv-python下载却显示下载失败: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly 直接运用conda安装: 随后完成cv2的安装。

    2024年02月10日
    浏览(26)
  • docker save 命令 docker load 命令 快速复制容器

    docker save 命令用于在系统上把正在使用的某个容器镜像 导出成容器镜像文件保存下载,以便在其他系统上导入这个容器镜像文件 以便快速在其他服务器上启动相同的容器。 查看redis容器和镜像 导出redis镜像文件 注意命令中 -o 跟的是导出的镜像文件的文件名 可以任意命名 本

    2024年03月15日
    浏览(47)
  • docker基于save保存镜像与基于load加载镜像

    #以busybox镜像创建一个容器,在容器中创建一个hello.txt的文件。 #拉取busybox 最新镜像,实际生产中,docker pull 这一步可以省略,docker run的时候会自己去拉取。 docker pull busybox docker run --name container1 busybox touch hello.txt #将对容器container1做出的修改提交为一个新镜像,镜像名为b

    2024年02月04日
    浏览(26)
  • Could not build wheels for opencv-python-headless which use PEP 517 and cannot be installed directly

    笔者是python环境下安装 albumentations 出现的,该库经常用于图像增强,在cv领域有很大的知名度。在使用下边的命令进行安装后 就报了 ERROR:Could not build wheels for opencv-python-headless which use PEP 517 and cannot be installed directly 。 albumentations库依赖opencv,在直接使用pip命令安装时,albumen

    2024年02月15日
    浏览(50)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包