Open CV error in Python Layer Forward Pass

255 views
Skip to first unread message

Siavash Sakhavi

unread,
Sep 25, 2015, 12:55:48 PM9/25/15
to Caffe Users
Hi, 


I have written a Python Layer which uses cv2.imresize.

I check whether the layer works by itself and I have no error. (Test Mode)

When I want to train the network on ImageNet, the following error comes up:

OpenCV Error: The function/feature is not implemented (Unknown/unsupported array type) in size, file /home/siavash/opencv/modules/core/src/matrix.cpp, line 1561
*** Error in `./build/tools/caffe': free(): invalid pointer: 0x00007e68d28e5440 ***
*** Aborted at 1443199692 (unix time) try "date -d @1443199692" if you are using GNU date ***
PC: @     0x7f690100ecc9 (unknown)
*** SIGABRT (@0x3ea00005f10) received by PID 24336 (TID 0x7f6902ef9780) from PID 24336; stack trace: ***
    @     0x7f690100ed40 (unknown)
    @     0x7f690100ecc9 (unknown)
    @     0x7f69010120d8 (unknown)
    @     0x7f690104b394 (unknown)
    @     0x7f690105766e (unknown)
    @     0x7f68f95d177a cv::StdMatAllocator::deallocate()
    @     0x7f68f95d1e5c cv::Mat::deallocate()
    @     0x7e68d2642fc0 (unknown)
    @     0x7f6901c9124e (unknown)
    @     0x7f6901c9254d (unknown)
    @     0x7f6901cc76d0 (unknown)
    @     0x7f6901c33d43 (unknown)
    @     0x7f6901bbf7bd (unknown)
    @     0x7f6901c33d43 (unknown)
    @     0x7f6901cac577 (unknown)
    @     0x7f6901bef617 (unknown)
    @     0x7e68da6bdcdf caffe::PythonLayer<>::Forward_cpu()
    @     0x7f6902940461 caffe::Net<>::ForwardFromTo()
    @     0x7f69029407e7 caffe::Net<>::ForwardPrefilled()
    @     0x7f690292c969 caffe::Solver<>::Step()
    @     0x7f690292d1b5 caffe::Solver<>::Solve()
    @           0x40bb43 train()
    @           0x409481 main
    @     0x7f6900ff9ec5 (unknown)
    @           0x409c1b (unknown)
    @                0x0 (unknown)


I don't know why I get this error because it doesn't show up in my test for the layer. 

I check what the data type is in the forward pass (using GPU) and it's float 32 np array. 

Any suggestion regarding what the problem may be?

Regards

Siavash Sakhavi

unread,
Sep 25, 2015, 1:13:08 PM9/25/15
to Caffe Users
To test the layer, I load a dummy prototxt in python and do a forward pass in that environment.

for training, I call the ./build/tools/caffe function.


is it possible that opencv has a problem with this?

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/iiZjGxC9RdQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/35060ecf-0a2e-4d64-8cf2-5997471e9e8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Georg Waltner

unread,
Jun 1, 2016, 10:01:11 AM6/1/16
to Caffe Users
Hi Siavash,

I stumbled across the same problem. My workaround: scipy.misc.imresize. Works for me.

HTH, Georg.
Reply all
Reply to author
Forward
0 new messages