CLRNet icon indicating copy to clipboard operation
CLRNet copied to clipboard

How to train by a single gpu cuda:1 怎样只用cuda:1单gpu训练

Open SSSRgo opened this issue 2 years ago • 2 comments

I have changed the code to "self.net = MMDataParallel(self.net,device_ids=[self.cfg.gpus]).cuda(self.cfg.gpus)", but there is a mistake

Validate: 0%| | 0/70 [05:49<?, ?it/s] Traceback (most recent call last): File "/media/SSD/user1/SR/CLR/CLRNet-main/clrnet/engine/runner.py", line 143, in validate output = self.net.module.heads.get_lanes(output) File "/media/SSD/user1/SR/CLR/CLRNet-main/clrnet/models/heads/clr_head.py", line 500, in get_lanes keep = keep[:num_to_keep] RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

expecing for your answer

SSSRgo avatar May 28 '22 10:05 SSSRgo

You do not need to change code, you can try like this command: python main.py configs/clr_resnet18_culane.py --gpus 1

If still have problems, try set the cuda_env and run command like this: CUDA_VISIBLE_DEVICES=1 python main.py configs/clr_resnet18_culane.py --gpus 1

Hope this can help you~

MySuperSoul avatar May 28 '22 13:05 MySuperSoul

You do not need to change code, you can try like this command: python main.py configs/clr_resnet18_culane.py --gpus 1

If still have problems, try set the cuda_env and run command like this: CUDA_VISIBLE_DEVICES=1 python main.py configs/clr_resnet18_culane.py --gpus 1

Hope this can help you~

thank you

SSSRgo avatar May 28 '22 14:05 SSSRgo