1

Is there any way to print a textual representation of a tf-slim model along the lines of what nolearn offers:

## Layer information

name            size          total    cap.Y    cap.X    cov.Y    cov.X    filter Y    filter X    field Y    field X
--------------  ----------  -------  -------  -------  -------  -------  ----------  ----------  ---------  ---------
input           1x144x192     27648   100.00   100.00   100.00   100.00         144         192        144        192
Conv2DLayer     12x144x192   331776   100.00   100.00     2.08     1.56           3           3          3          3
Conv2DLayer     12x144x192   331776    60.00    60.00     3.47     2.60           3           3          5          5
MaxPool2DLayer  12x72x96      82944    60.00    60.00     3.47     2.60           3           3          5          5
...
DenseLayer      7                 7   100.00   100.00   100.00   100.00         144         192        144        192

EDIT:

I can use something like this to print the info for a given layer:

print("%s: %s" % (layer.name, layer.get_shape()))

what I would need to complete the table, would be some way to crawl or walk up the "layer stack" (i.e. get from a given layer to the incoming / input layer(s).

taion
  • 2,827
  • 1
  • 14
  • 22
Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120

1 Answers1

0

It is not textual representation that you seek, but maybe TensorBoard will suffice? You can visualize whole computation graph and monitor your model using this tool.

https://www.tensorflow.org/how_tos/summaries_and_tensorboard/

Kirill Dubovikov
  • 1,457
  • 2
  • 21
  • 41