Turoad / CLRNet

Pytorch implementation of our paper "CLRNet: Cross Layer Refinement Network for Lane Detection" (CVPR2022 Acceptance).
Apache License 2.0
495 stars 108 forks source link

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

Open SSSRgo opened 2 years ago

SSSRgo commented 2 years ago

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

MySuperSoul commented 2 years ago

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~

SSSRgo commented 2 years ago

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