traveller59 / second.pytorch

SECOND for KITTI/NuScenes object detection
MIT License
1.72k stars 721 forks source link

RuntimeError: CUDA error: no kernel image is available for execution on the device #111

Open jihong111 opened 5 years ago

jihong111 commented 5 years ago

hello, my computer Graphics card too old can i choose compile with cpu?, and i also change the train.py with, pickle_result = false.and it also report error ,

load 321 Truck database infos load 199 Tram database infos load 259 Misc database infos remain number of infos: 3712 remain number of infos: 3769 WORKER 0 seed: 1552570124 WORKER 1 seed: 1552570125 WORKER 2 seed: 1552570126 Traceback (most recent call last): File "./pytorch/train.py", line 689, in fire.Fire() File "/home/ljh/anaconda3/lib/python3.7/site-packages/fire/core.py", line 127, in Fire component_trace = _Fire(component, args, context, name) File "/home/ljh/anaconda3/lib/python3.7/site-packages/fire/core.py", line 366, in _Fire component, remaining_args) File "/home/ljh/anaconda3/lib/python3.7/site-packages/fire/core.py", line 542, in _CallCallable result = fn(*varargs, kwargs) File "./pytorch/train.py", line 414, in train raise e File "./pytorch/train.py", line 259, in train ret_dict = net(example_torch) File "/home/ljh/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, *kwargs) File "/home/ljh/Downloads/second.pytorch/second/pytorch/models/voxelnet.py", line 277, in forward voxel_features = self.voxel_feature_extractor(voxels, num_points) File "/home/ljh/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) File "/home/ljh/Downloads/second.pytorch/second/pytorch/models/voxel_encoder.py", line 205, in forward dim=1, keepdim=False) / num_voxels.type_as(features).view(-1, 1) RuntimeError: CUDA error: no kernel image is available for execution on the device

vincezhai commented 4 years ago

I met the same error, my gpu card is too old ,it cuda-cap is 3.0 according to the nvidia website. In my case, i just want to see the result using pretrained model, so when i try : python ./pytorch/train.py evaluate --config_path=./configs/car.lite.config --model_dir=/../pretrained_models_v1.5/car_lite --measure_time=True --batch_size=1 error occured ,the same as yours. The problem is you card is too old while your cuda version is too high,card which cuda-cap = 3.0 should use cuda-8.0, enter conda env and type conda install cudatoolkit=8 it will downgrade your cuda version and matched pytorch version etc try the code blow to check python

import torch import torchvision print(torch.cuda.is_available()) True a = torch.Tensor(5,3) a=a.cuda() print(a) tensor([[-9.1186e-16, 3.0750e-41, 2.8026e-44], [ 0.0000e+00, nan, 4.5650e-41], [ 1.3733e-14, 4.7429e+30, 1.9431e-19], [ 4.7429e+30, 5.0938e-14, 4.5156e+27], [ 7.1457e+31, 1.8891e+31, 5.0065e+35]], device='cuda:0')

if you see this ,means that this problem is solved

if you see Fasle : means you need to use the right version of pytorch (conda install pytorch )

after this , remove spconv build before && rebuild spconv in my case SECOND run successfully ,btw, I dont use this code to train ,i just want to evaluate the pretrained model provieded by the author