-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
运行时有个错误,请问如何解决? #1
Comments
predict.py脚本没有调用torch.utils.data这个函数库的东西,所以可能是pytorch版本问题,给你个排除思路: |
运行utils/dataloader.py文件,报错的话,可能就是这个脚本里的那个torch.utils.dataxx 导入需要修改。不过'BatchSamplerDistributedSamplerDataset'这个应该是自定义的数据导入类,也许你运行的predict.py不是Yolov3_LPRnet_pytorch这个项目里面的 |
谢谢您,我运行predict.py的时候是在项目里运行的,我看了一下我pytorch版本是1.71,但是不是1.71+cu101,我现在安装1.7.1+cu101试试 |
那pytorch应该不会有问题,不用重装,你运行utils/dataloader.py文件试试,这个没问题就不是环境的问题 |
运行utils/dataloader.py,显示报错 ModuleNotFoundError: No module named 'utils.utils'; 'utils' is not a package |
from torch.utils.data.dataset import Dataset,只保留这句,其他注释掉,没问题的话,重启一下重新打开这个项目,再运行,这样成功率51% |
在utils/dataloader.py中,只保留from torch.utils.data.dataset import Datase,运行utils/dataloader.py,没有报错; 再次运行predict.py时,还是报错AttributeError: module 'torch.utils.data' has no attribute 'BatchSamplerDistributedSamplerDataset' |
“BatchSamplerDistributedSamplerDataset”这个东西,你搜索一下项目里看看有没有把。可能那里无意中加上了 |
试了一下全局搜索 BatchSamplerDistributedSamplerDataset ,没有搜到,全局代码里没有BatchSamplerDistributedSamplerDataset,┭┮﹏┭┮ |
那什么问题都没有,重新电脑把,重开项目[捂脸] |
啊哈哈,好嘞 |
谢谢您嗷 |
不客气 |
您好,我运行predict.py时发生报错,请问一下如何解决呢?AttributeError: module 'torch.utils.data' has no attribute 'BatchSamplerDistributedSamplerDataset'
The text was updated successfully, but these errors were encountered: