chenyuntc / simple-faster-rcnn-pytorch

A simplified implemention of Faster R-CNN that replicate performance from origin paper
Other
3.99k stars 1.14k forks source link

Train error: nvrtc: error: invalid value for --gpu-architecture (-arch) #133

Closed herrickli closed 5 years ago

herrickli commented 5 years ago

I train with my own dataset which has 5 classes, I changed VOC_BBOX_LABEL_NAMES to my labels in voc_dataset.py and changed n_fg_clas=5 in faster_rcnn_vgg16.py, and then I came to this error:

load data
Traceback (most recent call last):
  File "/home/lc/anaconda3/envs/pytorch/lib/python3.6/site-packages/cupy/cuda/compiler.py", line 242, in compile
    nvrtc.compileProgram(self.ptr, options)
  File "cupy/cuda/nvrtc.pyx", line 98, in cupy.cuda.nvrtc.compileProgram
  File "cupy/cuda/nvrtc.pyx", line 108, in cupy.cuda.nvrtc.compileProgram
  File "cupy/cuda/nvrtc.pyx", line 53, in cupy.cuda.nvrtc.check_status
cupy.cuda.nvrtc.NVRTCError: NVRTC_ERROR_INVALID_OPTION (5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 132, in <module>
    fire.Fire()
  File "/home/lc/anaconda3/envs/pytorch/lib/python3.6/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/home/lc/anaconda3/envs/pytorch/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/home/lc/anaconda3/envs/pytorch/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "train.py", line 67, in train
    faster_rcnn = FasterRCNNVGG16()
  File "/home/lc/projects/simple-faster-rcnn-pytorch/model/faster_rcnn_vgg16.py", line 76, in __init__
    classifier=classifier
  File "/home/lc/projects/simple-faster-rcnn-pytorch/model/faster_rcnn_vgg16.py", line 115, in __init__
    self.roi = RoIPooling2D(self.roi_size, self.roi_size, self.spatial_scale)
  File "/home/lc/projects/simple-faster-rcnn-pytorch/model/roi_module.py", line 82, in __init__
    self.RoI = RoI(outh, outw, spatial_scale)
  File "/home/lc/projects/simple-faster-rcnn-pytorch/model/roi_module.py", line 31, in __init__
    self.forward_fn = load_kernel('roi_forward', kernel_forward)
  File "cupy/util.pyx", line 50, in cupy.util.memoize.decorator.ret
  File "/home/lc/projects/simple-faster-rcnn-pytorch/model/roi_module.py", line 18, in load_kernel
    kernel_code = cupy.cuda.compile_with_cache(code)
  File "/home/lc/anaconda3/envs/pytorch/lib/python3.6/site-packages/cupy/cuda/compiler.py", line 136, in compile_with_cache
    base = _preprocess('', options, arch)
  File "/home/lc/anaconda3/envs/pytorch/lib/python3.6/site-packages/cupy/cuda/compiler.py", line 97, in _preprocess
    result = prog.compile(options)
  File "/home/lc/anaconda3/envs/pytorch/lib/python3.6/site-packages/cupy/cuda/compiler.py", line 246, in compile
    raise CompileException(log, self.src, self.name, options)
cupy.cuda.compiler.CompileException: nvrtc: error: invalid value for --gpu-architecture (-arch)

Can someone help me, please!

herrickli commented 5 years ago

Wrong version of cupy, it should be cupy-cuda80 on my PC.