【问题标题】:RuntimeError: expected device cpu and dtype Byte but got device cpu and dtype BoolRuntimeError: expected device cpu and dtype Byte but got device cpu and dtype Bool
【发布时间】:2020-02-01 00:44:19
【问题描述】:

the issue I opened 中所述,在 CPU 上运行 Pytorch inverse-cooking 模型时出现以下错误:

RuntimeError: expected device cpu and dtype Byte but got device cpu and dtype Bool

我尝试在笔记本电脑的 Intel i7-4700HQ 8 线程和台式机 Ryzen 3700x 中运行 demo.ipynb 文件。我在笔记本电脑上使用 Arch Linux,在台式机上使用 Manjaro。

当我在 Google Collabs GPU 上运行该模型时,它运行良好。

根据demo.ipynb 文件,模型也应该能够在CPU 上运行。有谁知道我是否必须调整任何参数才能使其工作?

【问题讨论】:

  • 我认为它应该与 Pytorch 0.4 一起运行,而您可能正在使用 1.x

标签: pytorch cpu archlinux


【解决方案1】:

正如@iacolippo 和评论会话以及myDennisCode 所述,问题确实出在依赖版本上。我有torchvision==0.4.0(这让我很困惑)和torch==1.2.0

要解决此问题,只需安装 torch==0.4.1torchvision==0.2.1

【讨论】:

    猜你喜欢
    • 2019-12-13
    • 1970-01-01
    • 2021-03-26
    • 2021-12-24
    • 2021-04-27
    • 2021-07-18
    • 1970-01-01
    • 2021-03-03
    • 2021-03-19
    相关资源
    最近更新 更多