ModuleNotFoundError:没有名为“torch.utils.serialization"的模块 [英] ModuleNotFoundError: No module named 'torch.utils.serialization'

查看:25
本文介绍了ModuleNotFoundError:没有名为“torch.utils.serialization"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行一个使用 Pytorch 的项目时,我想出了这个错误:

When I run a project used Pytorch I came up with this error:

Traceback (most recent call last):
File "train_drnet.py", line 10, in <module>
import utils
File "/home/muse/drnet-py/utils.py", line 18, in <module>
from data.kth import KTH 
File "/home/muse/drnet-py/data/kth.py", line 7, in <module>
from torch.utils.serialization import load_lua
ModuleNotFoundError: No module named 'torch.utils.serialization'

请问怎么解决?

推荐答案

我认为它大约在一年前从 Pytorch 中删除,您可以尝试使用 tourch 文件代替 - https://github.com/bshillingford/python-torchfile

I think it was removed from Pytorch about a year ago, you can try tourch file instead - https://github.com/bshillingford/python-torchfile

这篇关于ModuleNotFoundError:没有名为“torch.utils.serialization"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆