interactive-deep-colorization icon indicating copy to clipboard operation
interactive-deep-colorization copied to clipboard

What is the exact cause of the crash?

Open vlasenkov opened this issue 8 years ago • 11 comments

$ python ideepcolor.py 
objc[10305]: Class CVWindow is implemented in both /Users/sansan/anaconda/lib/libopencv_highgui.3.2.0.dylib and /usr/local/opt/opencv/lib/libopencv_highgui.2.4.dylib. One of the two will be used. Which one is undefined.
objc[10305]: Class CVView is implemented in both /Users/sansan/anaconda/lib/libopencv_highgui.3.2.0.dylib and /usr/local/opt/opencv/lib/libopencv_highgui.2.4.dylib. One of the two will be used. Which one is undefined.
objc[10305]: Class CVSlider is implemented in both /Users/sansan/anaconda/lib/libopencv_highgui.3.2.0.dylib and /usr/local/opt/opencv/lib/libopencv_highgui.2.4.dylib. One of the two will be used. Which one is undefined.
objc[10305]: Class CaptureDelegate is implemented in both /Users/sansan/anaconda/lib/libopencv_videoio.3.2.0.dylib and /usr/local/opt/opencv/lib/libopencv_highgui.2.4.dylib. One of the two will be used. Which one is undefined.
[user_study] = False
[dist_caffemodel] = ./models/reference_model/model.caffemodel
[ui_time] = 60
[load_size] = 256
[color_prototxt] = ./models/reference_model/deploy_nodist.prototxt
[color_caffemodel] = ./models/reference_model/model.caffemodel
[dist_prototxt] = ./models/reference_model/deploy_nopred.prototxt
[no_dist] = False
[gpu] = 0
[image_file] = test_imgs/mortar_pestle.jpg
[win_size] = 512
ColorizeImageCaffe instantiated
gpu_id = 0, net_path = ./models/reference_model/deploy_nodist.prototxt, model_path = ./models/reference_model/model.caffemodel
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0521 17:42:31.874128 2128352000 common.cpp:66] Cannot use GPU in CPU-only Caffe: check mode.
*** Check failure stack trace: ***
Abort trap: 6

Why does it crashes? Is it two different OpenCV installations? Or CPU/GPU problem? Can this code run in CPU-only mode?

vlasenkov avatar May 21 '17 14:05 vlasenkov

It looks like you used the caffe-cpu packages. You can only have caffe-cpu OR caffe-gpu installed at the same time. This error will occur if you try to use the GPU mode with caffe-cpu.

SleepProgger avatar May 22 '17 19:05 SleepProgger

But ideepcolor.py uses caffe-gpu by default. Is there a way to run it with caffe-cpu?

vlasenkov avatar May 23 '17 06:05 vlasenkov

Use the parameter --cpu_mode for that.
That was added 2 days ago so you might need to update. But it will be pretty slow.

SleepProgger avatar May 23 '17 09:05 SleepProgger

@SleepProgger Use the parameter --cpu_mode for that.But still crashes,it show the message:

I0526 16:03:39.424075 5657 net.cpp:744] Ignoring source layer loss_class_SoftmaxLossPred_0_split I0526 16:03:39.424103 5657 net.cpp:744] Ignoring source layer loss_log Setting ab cluster centers in layer: pred_ab Setting upsampling layer kernel: pred_313_us test_imgs/mortar_pestle.jpg scale = 2.000000 Has been killed

How can i solve this problem?

mrlzc avatar May 26 '17 08:05 mrlzc

--cpu_mode option worked for me

vlasenkov avatar May 29 '17 10:05 vlasenkov

@mrlzc Have you tried to compile the Caffe with the python layer support? See this post for more details.

junyanz avatar Jun 19 '17 23:06 junyanz

same as @mrlzc , also I have compiled the caffe with the python layer support

BRUCE6 avatar Jan 18 '18 09:01 BRUCE6

I have solved this problem by changing the configuration of the virtual machine,can not compiled before because the virtual machine memory is too small,you can try it. good luck for you.

mrlzc avatar Jan 18 '18 10:01 mrlzc

Thanks for your tip! How much memory does it need? And how long does it need to process until the qt window shows up?

BRUCE6 avatar Jan 18 '18 20:01 BRUCE6

I can run the program on a GTX 1080 with 8 GB memory. The program consumes 4.5 GB GPU memory for the default test image mortar_pestle.jpg.

junyanz avatar Jan 19 '18 01:01 junyanz

The beginning of the virtual machine is the use of 4G memory,and then appeared above the kind of problem,then changed the memory from 4G to 8G,wait for a few minutes to complete all the operations.

mrlzc avatar Jan 19 '18 01:01 mrlzc