[mlpack] Loading Images, Issues

Ryan Curtin ryan at ratml.org
Mon Jan 6 22:24:51 EST 2020


On Mon, Jan 06, 2020 at 01:23:24PM +0000, Adithya Praveen wrote:
> Hey there I'm Adi !
> I've been tinkering around with mlpack for a couple days now. I've got
> a few things on my mind, and it would be really helpful if someone
> could guide me on these. a

Hi Adi,

Thanks for getting in touch.  I'll try my best to answer all three
points. :)

> 1. I see that the support for loading images was recently added to
> mlpack (I saw this on issue 1903).    Kudos on that contribution!
> However, i keep getting this error:        terminate called after
> throwing an instance of 'std::runtime_error'      what():  Load():
> HAS_STB is not defined, so STB is not available and images cannot be
> loaded!
>     Any help on how to resolve this issue would be very helpful.

When you compile mlpack, you'll need to make sure that the STB library
is found.  You can see the output when you run cmake.  Actually, CMake
should download STB if it's not available---so, it sounds like maybe you
have installed mlpack from the package manager, and perhaps the package
manager you installed from did not have that support.  You might have to
compile it yourself then.

> 2. Issue 1903 states that documentation has been added for loading
> images (on the checklist at the top of this issue).    However, I'm
> having a hard time finding this documentation. If anyone could point
> me towards those resources, that    would be helpful.

Oh, I see... there is a tutorial in doc/tutorials/image/image.txt, but
that was never added to the list of tutorials in mlpack/core.hpp or
anywhere else, so the website doesn't link to it.  Here's a direct link
to that tutorial:

https://www.mlpack.org/doc/mlpack-3.2.2/doxygen/imagetutorial.html

>     I would also like to add that I would be happy to add this
> documentation myself if such documentation does not exists,     once I
> understand the reason behind 1 (referring to point 1 described above).

Yeah, if you want to update the Doxygen documentation to fix this, that
would be great!

> 3. I have proposed a solution to the issue stated in 2138 with regard
> to the DecisionTree classifier. Again, it would be great    if anyone
> could give their comments on my reply to the issue, and that if it
> resolves the issue itself. Cheers,Adi.

Glancing at your answer, that's roughly what I would have suggested. :)
Both the mlpack_hoeffding_tree and mlpack_decision_tree command-line
bindings (or Python/Julia bindings) should be able to work with that
data, but manually encoding them as integers should be fine too.  To
load categorical data like that, you can use the overload of
data::Load() that takes a DatasetInfo, which will store information on
the dimensions that are categorical and numeric.

Hope this helps!

Thanks,

Ryan

-- 
Ryan Curtin    | "I'm so likable!"
ryan at ratml.org |  - Frank


More information about the mlpack mailing list