rbgirshick/py-faster-rcnn

faster rcnn runs in windows and error occurs

wait1988 opened this issue · 5 comments

I1207 16:32:10.283551 732336 python_layer.hpp:66] Traceback (most recent call last):
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\rpn\proposal_layer.py", line 143, in forward
keep = nms(np.hstack((proposals, scores)), nms_thresh)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\fast_rcnn\nms_wrapper.py", line 17, in nms
return cpu_nms(dets, thresh)
File "nms\cpu_nms.pyx", line 25, in nms.cpu_nms.cpu_nms (nms\cpu_nms.c:1756)
cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]
ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long'
Traceback (most recent call last):
File "./tools/demo.py", line 142, in
_, _= im_detect(net, im)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\fast_rcnn\test.py", line 155, in im_detect
blobs_out = net.forward(**forward_kwargs)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\caffe-fast-rcnn\python\caffe\pycaffe.py", line 95, in _Net_forward
self._forward(start_ind, end_ind)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\rpn\proposal_layer.py", line 143, in forward
keep = nms(np.hstack((proposals, scores)), nms_thresh)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\fast_rcnn\nms_wrapper.py", line 17, in nms
return cpu_nms(dets, thresh)
File "nms\cpu_nms.pyx", line 25, in nms.cpu_nms.cpu_nms (nms\cpu_nms.c:1756)
ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long'

I've fixed this error by replacing int_t to int32_t

Hi, wait1988,

Could you tell me how you modify setup.py in windows. When I run it in windows, this issue occurred:
clxx: fatal error C1083: cannot open source file:"-fPIC". How should I set nvcc compiler-options when I compile gpu_nms.pyx?

when i try to run faster rcnn than i got like this kind of error, i'm using gtx970. thanks in advance

shape
I0719 14:46:28.321624 9405 net.cpp:150] Setting up rpn_cls_prob_reshape
I0719 14:46:28.321630 9405 net.cpp:157] Top shape: 1 18 15 15 (4050)
I0719 14:46:28.321635 9405 net.cpp:165] Memory required for data: 21835056
I0719 14:46:28.321638 9405 layer_factory.hpp:77] Creating layer proposal
F0719 14:46:28.321650 9405 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python (known types: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Concat, ContrastiveLoss, Convolution, Data, Deconvolution, Dropout, DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, LRN, Log, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Pooling, Power, ROIPooling, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, SmoothL1Loss, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, WindowData)
*** Check failure stack trace: ***
Aborted (core dumped)

When I run test_net.py on windows error occurred in .\lib\utils\nms.pyx. The problem was:
ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long'
I replaced 'int_t' in line 25 with intp_p, int32_t and int64_t, the error reported was always:
ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long'
Any one met the same problem?

I've change the corresponding line to cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1].astype('int32')