Re: [Dclib-devel] dlib fatal error with output_tensor
Brought to you by:
davisking
From: Davis K. <dav...@us...> - 2016-12-02 16:09:13
|
Don't spam questions to multiple forums. I answered this on stackoverflow already. Moreover, if you had read the documentation for the things you are using you would have understood why it was wrong in the first place. On Fri, Dec 2, 2016 at 11:01 AM, <dav...@gm...> wrote: > Hi everybody, > > I am currently working on a face detection application using RCNN > algorithm. The code in developed in dlib-19.2 C++. My Operating System is > Windows 10 Home Edition. The framework is Qt 5.7. > > My 781 images (height:228 and width:307) inside are inside a vector called > "images" > > *std::vector<matrix<rgb_pixel>> images;* > > Afterwards, I split "images" into two vectors: One containing the training > images (389 in total) and the testing images (391 in total): > > *std**:**:vector**<**dlib**:**:matrix**<**dlib**:**:rgb_pixel**>>** training_images(images.begin(), images.begin() + half_size);* > > *std**:**:vector**<**dlib**:**:matrix**<**dlib**:**:rgb_pixel**>>** testing_images(images.begin() + half_size, images.end());* > > Then, I tried to train the RCNN network using the train() function: > > *template <long num_filters, typename SUBNET> using con5d = con<num_filters,5,5,2,2,SUBNET>;* > > > > *template <long num_filters, typename SUBNET> using con3 = con<num_filters,3,3,1,1,SUBNET>;* > > > > *template <typename SUBNET> using downsampler = relu<bn_con<con5d<32, relu<bn_con<con5d<32, relu<bn_con<con5d<32,SUBNET>>>>>>>>>;* > > > > *template <typename SUBNET> using rcon3 = relu<bn_con<con3<32,SUBNET>>>;* > > > > *using net_type = loss_binary_log<con<1,6,6,1,1,rcon3<rcon3<rcon3<downsampler<input_rgb_image_pyramid<pyramid_down<6>>>>>>>>;* > > > > *net_type net;* > > *dnn_trainer<net_type> trainer(net);* > > *trainer.set_learning_rate(0.01);* > > *trainer.set_min_learning_rate(0.00001);* > > *trainer.set_mini_batch_size(5);* > > *trainer.be_verbose();* > > *trainer.train(training_images, training_labels);* > > However, this does not work. The following error appears every single time > I run the code: > > *Error** detected at line 179. Error detected in file ../../Desktop/dlib-19.2/dlib/dnn/loss.h. Error detected in function double dlib::loss_binary_log_::compute_loss_value_and_gradient(const dlib::tensor&, const_label_iterator, SUBNET&) const [with const_label_iterator = __gnu_cxx::__normal_iterator >; SUBNET = dlib::dimpl::subnet_wrapper, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::add_layer, dlib::input_rgb_image_pyramid >, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, void>, true, void>].* > > > > *Failing** expression was output_tensor.nr() == 1 && output_tensor.nc() == 1 && output_tensor.k() == 1.* > > I really do not know what is going on. Could you help me please ? > > Thank you very much for all your answers. > > David > > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Dclib-devel mailing list > Dcl...@li... > https://lists.sourceforge.net/lists/listinfo/dclib-devel > > |