hughperkins / DeepCL

OpenCL library to train deep convolutional neural networks
Mozilla Public License 2.0
865 stars 199 forks source link

CMD API Help needed #74

Closed merceyz closed 8 years ago

merceyz commented 8 years ago

As "requested" in issue #73 i'm moving my question part here

I'm trying to use the CMD API to have a network learn to label some 96x96x3 (RGB) images.

I have a folder structure where each folder for each label has a bunch of images dceeb1b8098bbbec435598086613b460 147bc888df3ea38578d239e6525beb8e (water)

I opened cmd and ran the following commands:

  1. cd "path to folder here"
  2. echo off
  3. cls
  4. call .\bin\activate.bat
  5. deepcl_unittests

This resulted in the following output 970fa81b05292c65274d5321acb3b80c

Now i'm kind of stuck, I was reading on this page at the "File types" section there is a line saying "See Loaders for information on available loaders" which doesn't work, the link leads to an 404 page

So my question/issue is: How do I give it data to train/test on?

hughperkins commented 8 years ago

Ok, so deepcl_unittests is for running automated unit tests, to check stuff is working ok. To run training you'll want to use deepcl_train.

merceyz commented 8 years ago

Yeah i figured as much, but how do i present it with my data?

hughperkins commented 8 years ago

Ah, good point .Link should work now https://github.com/hughperkins/DeepCL/blob/master/doc/Loaders.md

merceyz commented 8 years ago

That jpeg loader will use RGB right or do i have to specify something for that?

hughperkins commented 8 years ago

Oh, good question. I think you just need to put planes=3 in the manifest, and then it should work. Can you try ,and see if this works ok?

hughperkins commented 8 years ago

(I think the only requirements on the images are:

merceyz commented 8 years ago

42017794fd46d166352604a8857c98b2

b891055c923e4c5ec2a0099ed7186e67

4b108e9f3211e10d5a9b6f76dc9380e9

All requirements are met

hughperkins commented 8 years ago

Works ok?

merceyz commented 8 years ago

"Something went wrong: can't open *file name here"

hughperkins commented 8 years ago

Does it really say '*file name here'? or does that have an actual filepath?

merceyz commented 8 years ago

If you look at the first screenshot you can see the actual path

hughperkins commented 8 years ago

ah...

hughperkins commented 8 years ago

ok, can you try removing the leading /, ie 0/620cc66f-f919-...etc..

merceyz commented 8 years ago

Same error

hughperkins commented 8 years ago

Looks like the filepath is relative to the current directory, not to the datadir. That's probably not really intuitive, or correct, but I think that's how it works currently. Can you try using either absolute paths, or paths relative to the current directory? (Might need to add TestFolder/ to the start of each path?)

merceyz commented 8 years ago

That fixed it and it puked out a bunch of stuffs

a36d961b362d84af1b8acfa950607e39

If i'm not mistaken something is wrong tho as "training loss" says "-1.#IND" and all values are the same on each epoch finished

hughperkins commented 8 years ago

ah yeah, that training loss means someting went wrong...

hughperkins commented 8 years ago

maybe try a smaller learning rate?

merceyz commented 8 years ago

There we go, loss started at ~800 going down more and more

Accuracy on both the training and test keeps climbing so it appears to be working :+1:

It got to epoch 12 and "clblas teardown" showed up, i assume that's it's built in "limit"

hughperkins commented 8 years ago

Accuracy on both the training and test keeps climbing so it appears to be working

Cool :-)

It got to epoch 12 and "clblas teardown" showed up, i assume that's it's built in "limit"

By default, it trains 12 epochs :-P You can change that using numepochs=100 (or however many epochs yo uwant)

merceyz commented 8 years ago

Awesome, thanks.

Suggesting a fix to this:

Looks like the filepath is relative to the current directory, not to the datadir. That's probably not really intuitive, or correct, but I think that's how it works currently. Can you try using either absolute paths, or paths relative to the current directory? (Might need to add TestFolder/ to the start of each path?)

Otherwise i have no more questions for now so you can close this issue if you like (or keep it open as a reminder of the quote above)

hughperkins commented 8 years ago

I'll close this, since it is more general, but you could open an issue specifically for the filepath perhaps?

hughperkins commented 8 years ago

(for info, I've fixed the issue with relative path, in the sourcecode. Question: are you using a prebuilt release, or building from source?)

merceyz commented 8 years ago

Prebuilt. http://deepcl.hughperkins.com/Downloads/ http://deepcl.hughperkins.com/Downloads/deepcl-win64-v8.3.1.zip