gpt4 book ai didi

python - 没有名为 'torch.utils.data.distributed' 的模块

转载 作者:太空宇宙 更新时间:2023-11-03 14:28:02 24 4
gpt4 key购买 nike

我在Windows 10上安装了anaconda和pytorch,安装时没有出现错误。

但我不知道为什么我的pytorch中没有模块或包。您是否遇到过同样的问题?

这是我正在测试的程序:https://github.com/pytorch/examples/blob/master/imagenet/main.py

最佳答案

由于您没有提供任何其他信息,因此您可以尝试以下几种操作:

1) 首先确保您已经安装了 torchvision

2)然后尝试以下导入:

# this import is necessary
import torch.utils.data

关于python - 没有名为 'torch.utils.data.distributed' 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47483385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com