CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

DumpNode don't work with CNN

Open rodrigoalor opened this issue 10 years ago • 4 comments

Hello, I'm trying to get the convolutional layers parameters of my model but I get this exception:

Warning: node name 'AllNodes' does not exist in the network. dumping all nodes instead.

[CALL STACK] > 00007FF7F7781A41 (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F75E160C (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F75E0D61 (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F762CE2D (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F76248E8 (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F75E77B0 (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F75E7EBC (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F75E8196 (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - 00007FF7F7800963 (SymFromAddr() error: Se ha intentado tener acceso a una dirección no válida.) - BaseThreadInitThunk - RtlUserThreadStart

EXCEPTION occurred: Node 'conv1_act.b' (LearnableParameter operation): Sample [1 x 1 x 16] is not a column vector or matrix (1D or 2D tensor).

the configuration is the next:

DumpNodeInfo = [ action = "dumpNode" modelPath="$ModelDir$/01_Convolution.15" printValues = true ]

When I use the same configuration in models with only fully connected layers it works. isn't possible get this paramenters? Thank you for you attention.

rodrigoalor avatar Oct 06 '16 14:10 rodrigoalor

As far as I know there is no writer that can write high-dimensional output such as a 3D tensor. Also, in what file format would you want a 3D tensor to be written, anyways? Probably the easiest way to get the hidden units is to use the C++ or C# evaluation interface. This allows you to evaluate any variable from the network and retrieve it as a 1D vector where all values are serialized. If you know the shape of the data, you can visualize and/or write it to disk just the way you prefer using C++ or C# code.

e-thereal avatar Oct 07 '16 07:10 e-thereal

Thank you so much. I didn't know the C# interface can be used to get the weights of the model and not only the hidden layers output. .

rodrigoalor avatar Oct 07 '16 19:10 rodrigoalor

Just as a side-note: There are two Evaluate() methods, one taking two arguments and one taking only one argument (at least that's how the C++ interface works). The two-argument method requires you to specify a map to the inputs and a second map that stores the output of the evaluation. This one is used to evaluate hidden and output units (all units that depend on some input). If you want to evaluate the weights, which don't depend on the input, you have to use the second Evaluate() method that only takes one map storing the result of your evaluate request.

e-thereal avatar Oct 10 '16 06:10 e-thereal

Closing. Feel free to reopen.

n17s avatar Oct 28 '16 21:10 n17s