Help creating I/O images for example : mnist_autoencoder

108 views
Skip to first unread message

Mohit Jain

unread,
Jun 12, 2015, 5:16:50 PM6/12/15
to caffe...@googlegroups.com
Hey,
    I'm a beginner with Caffe and want to run the mnist-autoencoder example (the autoencoder one, not the LeNet on MNIST). I have successfully trained the model using the prototxt files already provided, however would like to get better insight as to whether my model trained nicely or not by comparing the input image and the reconstructed image. Can someone tell me how can I do this?

Regards,
Mohit

J. Yegerlehner

unread,
Jun 21, 2015, 10:10:40 PM6/21/15
to caffe...@googlegroups.com
Hi Mohit,

You may wish to ignore this suggestion: I often find that Caffe has features exposed in python that I'm not aware of that do things in a "friendlier" way than I usually use. So there may already be some feature there that is an easier way to do what you want that I don't know about.

But if you should be a C++ person I wrote a utility to do what you are doing (write an autoencoded output image to a file from my net), except that in my case the images are not 1-channel like in MNIST, but 3-channel color images. This is the utility here:

https://github.com/jyegerlehner/caffe/blob/nat_img_autoenc/tools/prop-patches.cpp

The nice thing about it is that you just drop that cpp file into the caffe/tools/ directory, and then when you build caffe (at least with the cmake build; I don't use the makefile build), it will generate an executable called prop-patches. On the command line you give it the trained .caffemodel, the net's prototxt file, the input directory and output directory, and it runs all the images in the input directory through the net, and creates corresponding output images in the specified output directory.  I don't know that it will work exactly as is for your use case since I use it for regular 3-channel RGB images, but perhaps it will since one would expect opencv can handle gray-scale or black and white images too.

There are some other utilities in that source directory too, that show reading from and writing to lmdb or leveldb databases to noise images and so forth.

Hope that's helpful.



Mohit Jain

unread,
Jun 22, 2015, 5:10:22 AM6/22/15
to J. Yegerlehner, caffe...@googlegroups.com
Hey Yegerlehner!
      Thank you so much for taking time to write this suggestion and helping me out! I am onto checking if this helps my use case (my instinct says it would). 

Thanks!
Mohit

--
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/t0P9Hgz-e8I/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/bff4fd94-0705-4169-87d1-46aeb182c1cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dixon Dick

unread,
Sep 1, 2015, 7:08:21 PM9/1/15
to Caffe Users
Hi and thank you for posting such useful code. I'd like to try it out.

When I run the cmake and make all there is a liboost_filesystem not linking. Where does one add this to the make process please?

dcd
Reply all
Reply to author
Forward
0 new messages