mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

how to print the input/output shape and data

Open gsunilkumar1 opened this issue 8 years ago • 6 comments

When I was working with a adversary_generation example ,sometimes i want to see how the output of each layer and also the print the input_data and col_buffer and weight_3d(weight vector) data in convolution-inl.h since i am running into nan loss for training accuracy, so I want to check by printing the shape and data for convolution,activation and pooling Is it possible to see each layer output and also each operation of a layer??

gsunilkumar1 avatar Sep 04 '18 13:09 gsunilkumar1

Thank you for the question @gsunilkumar1 , We will get back to you on this

@mxnet-label-bot [Question]

vrakesh avatar Sep 04 '18 15:09 vrakesh

Hi, if you would like any intermediate info within operators you can print them out using LOG(INFO) like what's being done here: https://github.com/apache/incubator-mxnet/blob/5a9c3af4b101b85047b306575575ea9022a8474e/src/common/exec_utils.h#L300.

haojin2 avatar Sep 05 '18 00:09 haojin2

Thanks for the inputs, Can i also print the input_data and col_buffer of the following. https://github.com/apache/incubator-mxnet/blob/master/src/operator/nn/convolution-inl.h#L223 Will the LOG(INFO) can be used to print it ? How can i print those information

gsunilkumar1 avatar Sep 05 '18 07:09 gsunilkumar1

So you want to inspect the contents in the data buffer? It'll be a bit tricky here if your buffer is in GPU context, but if it's in CPU context then you can use LOG(INFO) plus the data pointer to print specific elements out.

haojin2 avatar Sep 05 '18 18:09 haojin2

@gsunilkumar1 could you please close this issue if your question has been answered? You can also use discuss.mxnet.io to learn about mxnet usage

kalyc avatar Sep 11 '18 16:09 kalyc

Yeah i will close the ticket. Thanks for the inputs. Please suggest if there is a way to check buffers in GPU context

gsunilkumar1 avatar Sep 12 '18 05:09 gsunilkumar1