IrisRainbowNeko / genshin_auto_fish

基于深度强化学习的原神自动钓鱼AI
4.76k stars 724 forks source link

yolox训练必须要cuda吗 #215

Closed BeidouStarX closed 2 years ago

BeidouStarX commented 2 years ago

AttributeError: module 'torch._C' has no attribute '_cuda_setDevice' 我a卡没办法弄cuda

LittleMio commented 2 years ago

既然你是a卡装不了cuda,你可以安装cpu版的torch,只不过训练速度会比较慢

BeidouStarX commented 2 years ago

既然你是你卡装不了cuda,你可以安装cpu版的torch,只不过训练速度会比较慢

安装了cpu版的依旧是这个报错

BeidouStarX commented 2 years ago

既然你是你卡装不了cuda,你可以安装cpu版的torch,只不过训练速度会比较慢

运行requirements.py会自动下载torch1.7.0cpu,但需要的是1.10.1,解决后安装yolox和yolox训练训练都显示错误 ModuleNotFoundError: No module named 'typing_extensions' 但typing是已经安装了的

BeidouStarX commented 2 years ago

既然你是你卡装不了cuda,你可以安装cpu版的torch,只不过训练速度会比较慢

运行requirements.py会自动下载torch1.7.0cpu,但需要的是1.10.1,解决后安装yolox和yolox训练训练都显示错误 ModuleNotFoundError: No module named 'typing_extensions' 但typing是已经安装了的

yolox训练依旧是报错AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

BeidouStarX commented 2 years ago

2022-01-04 04:26:48 | ERROR | yolox.core.launch:98 - An error has been caught in function 'launch', process 'MainProcess' (12036), thread 'MainThread' (8268): Traceback (most recent call last):

File "yolox_tools\train.py", line 133, in args=(exp, args), │ └ Namespace(batch_size=8, cache=False, ckpt='weights/yolox_tiny.pth', devices=1, dist_backend='nccl', dist_url=None, exp_file='... └ ╒══════════════════╤════════════════════════════════════════╕ │ keys │ values │ ╞...

File "d:\genshin_auto_fish\yolox\core\launch.py", line 98, in launch main_func(*args) │ └ (╒══════════════════╤════════════════════════════════════════╕ │ │ keys │ values │ │ ... └ <function main at 0x00000209905019D8>

File "yolox_tools\train.py", line 110, in main trainer.train() │ └ <function Trainer.train at 0x0000020985DA21E0> └ <yolox.core.trainer.Trainer object at 0x0000020990506978>

File "d:\genshin_auto_fish\yolox\core\trainer.py", line 71, in train self.before_train() │ └ <function Trainer.before_train at 0x0000020985DDCF28> └ <yolox.core.trainer.Trainer object at 0x0000020990506978>

File "d:\genshin_auto_fish\yolox\core\trainer.py", line 133, in before_train torch.cuda.set_device(self.local_rank) │ │ │ │ └ 0 │ │ │ └ <yolox.core.trainer.Trainer object at 0x0000020990506978> │ │ └ <function set_device at 0x000002095588FAE8> │ └ <module 'torch.cuda' from 'D:\anaconda3\envs\ysfish\lib\site-packages\torch\cuda\init.py'> └ <module 'torch' from 'D:\anaconda3\envs\ysfish\lib\site-packages\torch\init.py'>

File "D:\anaconda3\envs\ysfish\lib\site-packages\torch\cuda__init__.py", line 311, in set_device torch._C._cuda_setDevice(device) │ │ └ 0 │ └ <module 'torch._C' from 'D:\anaconda3\envs\ysfish\lib\site-packages\torch\_C.cp36-win_amd64.pyd'> └ <module 'torch' from 'D:\anaconda3\envs\ysfish\lib\site-packages\torch\init.py'>

AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

IrisRainbowNeko commented 2 years ago

yolox一部分代码是基于cuda写的,没有考虑cpu训练,因为慢到无法接受

BeidouStarX commented 2 years ago

问题已经解决了,弄了张n卡来算

---原始邮件--- 发件人: @.> 发送时间: 2022年2月28日(周一) 下午3:48 收件人: @.>; 抄送: @.**@.>; 主题: Re: [7eu7d7/genshin_auto_fish] yolox训练必须要cuda吗 (Issue #215)

yolox一部分代码是基于cuda写的,没有考虑cpu训练,因为慢到无法接受

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>