lzx1413 / PytorchSSD

pytorch version of SSD and it's enhanced methods such as RFBSSD,FSSD and RefineDet
MIT License
709 stars 237 forks source link

i meet a problem #82

Closed YYZ-rose closed 5 years ago

YYZ-rose commented 5 years ago

Training FSSD_mobile on VOC0712 Total params: 7.93M THCudaCheck FAIL file=torch/csrc/cuda/Module.cpp line=88 error=10 : invalid device ordinal Traceback (most recent call last): File "train_test_fssd_mobile_pre.py", line 469, in train() File "train_test_fssd_mobile_pre.py", line 320, in train out = net(images) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call result = self.forward(*input, *kwargs) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 64, in forward inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 75, in scatter return scatter_kwargs(inputs, kwargs, device_ids, dim=self.dim) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/scatter_gather.py", lin e 30, in scatter_kwargs inputs = scatter(inputs, target_gpus, dim) if inputs else [] File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/scatter_gather.py", lin e 25, in scatter return scatter_map(inputs) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/scatter_gather.py", lin e 18, in scatter_map return list(zip(map(scatter_map, obj))) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/scatter_gather.py", lin e 15, in scatter_map return Scatter.apply(target_gpus, None, dim, obj) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/_functions.py", line 68 , in forward outputs = comm.scatter(input, ctx.target_gpus, ctx.chunk_sizes, ctx.dim, streams) File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/cuda/comm.py", line 188, in scatter with torch.cuda.device(device), torch.cuda.stream(stream): File "/home/yangyuze/anaconda3/lib/python3.6/site-packages/torch/cuda/init.py", line 189, in e nter torch._C._cuda_setDevice(self.idx) RuntimeError: cuda runtime error (10) : invalid device ordinal at torch/csrc/cuda/Module.cpp:88

YYZ-rose commented 5 years ago

i solve it , train_test_fssd_mobile_pre.py line50:parser.add_argument('--gpu_id', default=[0, 1], type=int, help='gpus')
i only use one gpu(CUDA_VISIBLE_DEVICES=2 python train_test_fssd_mobile_pre.py -v FSSD_mobile -s 300 -d VOC),so chage the code to parser.add_argument('--gpu_id', default=[0], type=int, help='gpus')