Training Imagenet with 4 Channel ARGB png Images

490 views
Skip to first unread message

Daniel Blibaum

unread,
Nov 28, 2014, 2:03:00 AM11/28/14
to caffe...@googlegroups.com
Hi,

I've been trying to train a modification of imagenet on ARGB png images. I attempted to use the python interface to do classification of individual images since I was getting slightly odd results in training (though it does train without error), and wanted to diagnose where it was getting hung up. In doing so I got this error when loading the network, after it finishes initializing:

Check failed: target_blobs[j]->channels() == source_layer.blobs(j).channels() (4 vs. 3)

I understand that there's a channel mismatch somewhere, but I'm not sure precisely where. What exactly is this error telling me?

The command I used was:

net = caffe.Classifier('path/to/model/deploy.prototxt', 'path/to/model/model.caffemodel')

Evan Shelhamer

unread,
Nov 29, 2014, 6:33:25 PM11/29/14
to Daniel Blibaum, caffe...@googlegroups.com
Instead of the deploy model, you could try the training model to let it load the images by the data layer. The pycaffe load_image method might be discarding the alpha channel of the png images you're loading. It's only meant as a convenience for RGB and grayscale images.
--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, 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/a34306cf-db1f-474a-aa56-c9dfdf24adab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Toru Hironaka

unread,
Jun 29, 2015, 2:36:01 PM6/29/15
to caffe...@googlegroups.com, shel...@eecs.berkeley.edu, dsbl...@gmail.com
Hi, Even 

I also trained ImageNet with my ARGB images and I had the same problem as Daniel's problem. I think your are right. It looks like Alpha channel was ignored. Then, I found this link: https://github.com/BVLC/caffe/issues/1494. It says caffe can accept different K values. K value can be 4 or any number. I used the script from the link but I got the same problem. should I modify pycaffe for K channel value other than 1 or 3?
Reply all
Reply to author
Forward
0 new messages