moskewcz / boda

Boda: A C++ Framework for Efficient Experiments in Computer Vision
Other
63 stars 12 forks source link

How do I run boda for code generation? #15

Open macd opened 7 years ago

macd commented 7 years ago

I would like to run boda to read a Caffe network and output a compiled description for the Snapdragon. How would I do that?

I compiled boda with no errors, but most things turned off. Everything I do results in a similar error message:

root@7516aa433deb:/opt/boda/lib# ./boda --mode-arg=cnn_op_info ../nets/googlenet_conv error: type id str of '--mode-arg=cnn_op_info' did not match any derived class of has_main_t

What am I doing wrong? Thanks.

moskewcz commented 7 years ago

hi macd,

firstly, thanks for the question.

would like to run boda to read a Caffe network and output a compiled description for the Snapdragon. How would I do that?

i'm not sure what this means. it doesn't sounds like something boda can do, but maybe it's in the ballpark. you probably need to open a separate issue for your specific use-case with more details to pin down what you mean and/or want. but, read on first.

I compiled boda with no errors, but most things turned off. Everything I do results in a similar error message:

root@7516aa4:/opt/boda/lib# ./boda --mode-arg=cnn_op_info ../nets/googlenet_conv error: type id str of '--mode-arg=cnn_op_info' did not match any derived class of has_main_t

this is a basic usage/syntax error. you're trying to run a mode named "--mode-arg=cnn_op_info", and no such mode exists. all modes derive from 'has_main_t' (that's what makes them modes), and all modes have a 'type id string' which is used to name/specify them. not the friendliest error message, but accurate. this error will show up in other contexts where there are multiple options for some feature/module, not just for top level mode specification.

perhaps somehow this (top level) case should have special cased error reporting, i dunno. but, if you look at any of the existing examples, or run the program without arguments to see the usage message, you'll see the proper syntax. if you were looking at the usage, perhaps prior to looking at any examples, i think i can see where you got confused, and i'm open to a PR to revise the usage message. it may be little trickier than you might think because various things are auto-generated, so i don't really have full freedom with naming/syntax and such -- i need to match the auto-generated help message syntax with any hard-coded help text i write. the trade-off is less maintenance and special-case help/usage code, which is a very high priority for me given my scarce time. and, of course, not to put too fine a point on it, first-time-user experience isn't my highest priority at the moment.

What am I doing wrong? Thanks.

i think trying to jump to a specific task, especially one where you have no hard evidence that the framework can perform it (based only on my best guess of what you understand/know, mind you), while also trying to guess/learn basic usage isn't the best idea. i'd start with running the tests and some examples, as per the getting started guide. if you have problems with either of those tasks, open separate, specific issues for them.

then, given the level of maturity of the project, you'll probably need to explore the various modes and try to understand what they all do. in theory, they all have at least basic help (i.e. what is printed as part of the basic usage message), but it's sure to be incomplete and wrong in some areas. to gain more understanding, you'll need to review the code itself for the modes you think are interesting.

ideally, for modes (or sub-modes, or mode arguments) that are improperly documented but you're able to figure out, post a PR to fix/improve the help strings. per-mode documentation and/or examples are also welcome, but in many cases it might be premature to put much effort in that direction.

after looking at the code/comments, if there are modes where it's still so unclear what they do that you can't figure out if they're relevant to you, post an issue for them. bear in mind that almost all of this project in it's current state is aimed at developers with significant experience in CNNs, C++ development, metaprogramming, and high-performance algorithm design. not that all of those are needed for every part of the code of course, but the 'core' boda-rtc flows really do run down that whole list. in addition, familiarity at least one more mature/complete CNN middleware (such as caffe, torch, tensorflow, etc...), and one CNN compute library (such as cuDNN, neon's backends, caffe's 'native' compute, etc) might be a prerequisite for understanding the corresponding parts of the code.

if that all sounds too hard, then probably this project isn't the one for you in it's current state. otherwise, thanks in advance and good luck! i'll certainly leave this issue open for now for further discussion. as per many such issues, the long term plan would be to boil down the results of this issue and put it into the documentation (again PRs welcome).

moskewcz commented 7 years ago

and, now that i think about it, based on the title this is perhaps a duplicate issue; see #3