makefile / frcnn

Faster R-CNN / R-FCN :bulb: C++ version based on Caffe
Other
184 stars 75 forks source link

error: no matching function for call to 'data_augment, when make test #5

Open claudehang opened 6 years ago

claudehang commented 6 years ago

After successfully make all, I continue with make test while getting this error:

src/caffe/FRCNN/data_augment/test_augment.cpp: In function 'int test_main()':
src/caffe/FRCNN/data_augment/test_augment.cpp:32:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
  char *img_path = "test.jpg";
                   ^
src/caffe/FRCNN/data_augment/test_augment.cpp:82:94: error: no matching function for call to 'data_augment(cv::Mat&, std::vector<std::vector<float> >&, int&, float&, float&, float&, float&, float&)'
  Mat result = data_augment(origmat, rois, flip, jitter, rand_scale, hue, saturation, exposure);
                                                                                              ^
src/caffe/FRCNN/data_augment/test_augment.cpp:82:94: note: candidates are:
In file included from src/caffe/FRCNN/data_augment/test_augment.cpp:2:0:
src/caffe/FRCNN/data_augment/data_utils.hpp:55:7: note: image data_augment(image, box_label*, int, int, int, int, float, float, float, float, float)
 image data_augment(image orig, box_label *boxes, int num_boxes, int w, int h, int flip, float jitter, float scale, float hue, float saturation, float exposure);
       ^
src/caffe/FRCNN/data_augment/data_utils.hpp:55:7: note:   candidate expects 11 arguments, 8 provided
src/caffe/FRCNN/data_augment/data_utils.hpp:56:9: note: cv::Mat data_augment(cv::Mat&, std::vector<std::vector<float> >&, int, float, float, bool, float, float, float)
 cv::Mat data_augment(cv::Mat &orig, std::vector<std::vector<float> > &boxes, int flip, float jitter, float scale, bool random_rotate, float hue, float saturation, float exposure);
         ^
src/caffe/FRCNN/data_augment/data_utils.hpp:56:9: note:   candidate expects 9 arguments, 8 provided
make: *** [.build_release/src/caffe/FRCNN/data_augment/test_augment.o] Error 1
make: *** Waiting for unfinished jobs....

Couldn't find any valid solution. Any suggestions? Many Thanks!

claudehang commented 6 years ago

That was a easy fix. But then I came across something not right:

make: *** No rule to make target `.build_release/src/caffe/test/test_augment.o', needed by `.build_release/test/test_augment.testbin'.  Stop.
make: *** Waiting for unfinished jobs....

What should I do with this? Thanks!!

makefile commented 6 years ago

I once used the file test_augment.cpp just for temporary testing. You can delete this file or rename it. Sorry for that. By the way, I have never run make test, so I'm not sure whether there has other problem about testing.

claudehang commented 6 years ago

Oh, I see and you are so nice. Actually I want to get a file that locates in directory: build/examples/YOLO/demo_yolov3.bin and I simply could not find it after make all command. But examples/YOLO/demo_yolov3.sh requires for that very file. Could you give me any guidance? Really appreciate your kindly answer!

makefile commented 6 years ago

I can compile out the demo_yolov3.bin in my machine with make, maybe you can compile again or modify the Makefile.

claudehang commented 6 years ago

The ./examples/FRCNN/* part failed to compile and throw out error, which I took for warning. I can only delete all the file under this directory so as to proceed to compiling yolo example. Thanks dude!

claudehang commented 6 years ago

Hello~Recently I am curious about something of YOLOv3 in your code. Here is the code snippet in ./src/caffe/YOLO/yolo_layer.cpp:

void forward_yolo_layer_cpu(const float* input,layer l)
{
    //copy_gpu(l.batch*l.inputs,(float*)input,1,l.output_gpu,1);
    std::memcpy(l.output, (float*)input, l.batch*l.inputs*sizeof(float));
    int b,n;
    for(b = 0;b < l.batch;++b){
    for(n =0;n< l.n;++n){
        int index = entry_index(l,b,n*l.w*l.h,0);
            //activate_array_gpu(l.output_gpu + index, 2*l.w*l.h,LOGISTIC);
            activate_array(l.output + index, 2*l.w*l.h);
            index = entry_index(l,b,n*l.w*l.h,4);
            //activate_array_gpu(l.output_gpu + index,(1 + l.classes)*l.w*l.h,LOGISTIC);
            activate_array(l.output + index,(1 + l.classes)*l.w*l.h);
    }
    }
//    cuda_pull_array(l.output_gpu,l.output,l.batch*l.outputs);
}

I wonder why you are not using the commented function activate_array_gpu, which is intended to be a faster implementation with GPU computing for activation layer. By the way I did not find the code for function activate_array_gpu in your project. So what happened to this particular function? I would be very thankful for your replying!

makefile commented 6 years ago

The code about yolo layer is copied from pjreddie/darknet, and you can find the xx_gpu functions at that repo. I didn't include those gpu code cause I need time to modify the code to switch between GPU/CPU elegantly.

claudehang commented 6 years ago

Thanks man! Everything is clear after checking the source code of Darknet.