Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Logging in Mxnet, with different level (verbose, warning, error) #11557

Open
dmidge8 opened this issue Jul 4, 2018 · 8 comments
Open

Logging in Mxnet, with different level (verbose, warning, error) #11557

dmidge8 opened this issue Jul 4, 2018 · 8 comments

Comments

@dmidge8
Copy link

dmidge8 commented Jul 4, 2018

Hi,

As pointed out in this forum thread, https://discuss.mxnet.io/t/how-to-enable-logginig-for-c-api/1273/5 and https://discuss.mxnet.io/t/debug-mxnet-network-in-c/1274, there is a strong need felt to be able to log information and failed checks in MXNet.
It is mainly useful when using the C++ API, because there are no other feedback than the one you get when there is an error and than you need to dive deep in the code to finally get what went wrong. (For example, that the expected input shape of the symbol is not consistent to the one that has been gotten).

Moreover, a consistent way to get the logging information would be great. Meaning, one that doesn't need to modify environment variables and so on, would be appreciated. It would then be possible to have several level of logging, according on what is common in most of the projects out there, including "verbose, debug, info, warning, error".
Also, depending on the level of information gathered, having all the log output in file would be appreciated.

Thanks!

@szha
Copy link
Member

szha commented Jul 4, 2018

I think you can already get streams like LOG(severity) where severity can be FATAL, ERROR, WARNING, INFO. https://github.com/dmlc/dmlc-core/blob/649be18a8c55c48517861d67158a45dec54992ee/include/dmlc/logging.h#L162-L166

@dmidge8
Copy link
Author

dmidge8 commented Jul 4, 2018

Indeed. But when you use a compiled version of MXNet and you try to figure what is going wrong with it, you may want to toggle with several version of severity.

There, for now, every time you want to use the C++, since you don't have lot of feedback, you either have the choice of compiling the whole MXNet library with no log and then wonder what went wrong, or try to log everything and potentially being invaded by a lot of feedback that is thrown directly in the CLI.

A more interactive way to choose the level of information received would be a better solution. And if the checks where to embed some kind of logging, mainly when it fails, it would be better. And if all the logging where centralized and not disperse in the environment variable, I would even enjoy that more!

@safrooze
Copy link
Contributor

@dmidge8 one option for managing logs when they're all enabled would be to use a log viewer like glogg.

@Elijas
Copy link

Elijas commented Apr 2, 2020

Any updates?
Trying to remove

[16:09:01] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.3.0. Attempting to upgrade...
[16:09:01] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
[16:09:01] src/executor/graph_executor.cc:1984: Subgraph backend MKLDNN is activated.

from console output

@apeforest
Copy link
Contributor

You could set MXNET_SUBGRAPH_VERBOSE to 0 and these message will be muted. However, I think we should change the code to make default to 0 (currently is 1). It'll be a good first issue for new mxnet developers.

@Elijas
Copy link

Elijas commented Apr 3, 2020

You could set MXNET_SUBGRAPH_VERBOSE to 0 and these message will be muted.

@apeforest Thank you for a quick reply! It worked for graph_executor.cc, however, these still appear and I need to hide them:

[16:09:01] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.3.0. Attempting to upgrade...
[16:09:01] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!

Could you tell me the other environment variable?

@apeforest
Copy link
Contributor

There is no variable to disable that. And it's logged using INFO level.

@szha
Copy link
Member

szha commented Jul 29, 2020

requires dmlc/dmlc-core#623

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants