Skip to content
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

在torch >= 2.0中移除了名为“torch._six”的模块 coco_eval.py文件可能需要一些修改 #788

Open
leocn3 opened this issue Jan 25, 2024 · 2 comments

Comments

@leocn3
Copy link

leocn3 commented Jan 25, 2024

System information

  • Have I written custom code:Yes
  • OS Platform(e.g., window10 or Linux Ubuntu 16.04):window10
  • Python version:3.7
  • Deep learning framework and version(e.g., Tensorflow2.1 or Pytorch1.3):Pytorch2.1.0+cu121(Colab)
  • Use GPU or not:T4 GPU
  • CUDA/cuDNN version(if you use GPU):CUDA Version: 12.2
  • The network you trained(e.g., Resnet34 network):faster-RCNN

Describe the current behavior
在torch >= 2.0的环境中运行faster-RCNN等其他分支中运行coco_eval.py的会出现以下错误:

ModuleNotFoundError: No module named 'torch._six'

可以将coco_eval.py文件中
Line245 if isinstance(resFile, torch._six.string_classes):
修改为if isinstance(resFile, str):
即可避免使用'torch._six'模块

参考链接:https://blog.csdn.net/m0_72676510/article/details/134068860
https://www.cnblogs.com/emanlee/p/17658162.html (我认为这里降级torch并不是个好方法)

Error info / logs
ModuleNotFoundError: No module named 'torch._six'

@leocn3 leocn3 changed the title 在torch >= 2.0中移除了 在torch >= 2.0中移除了名为“torch._six”的模块 coco_eval.py文件可能需要一些修改 Jan 25, 2024
@leocn3
Copy link
Author

leocn3 commented Jan 25, 2024

Y老师在深度学习给了我非常大的帮助,这是我第一次提交issue,希望能有用

@WZMIAOMIAO
Copy link
Owner

确实是的,谢谢。等有空了再重新适配下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants