1

More specifically, I want to see the operations performed in the graph inside 'classify_image_graph_def.pb' which is inside Tensorflow's imagenet Inception model.

n00b
  • 1,549
  • 2
  • 14
  • 33
  • I've gotten this far: [x for x in sess.graph.get_operations() if x.type =='Conv2D'] which gives me 94 entries like 'import/mixed_5/tower_1/conv_1/Conv2D'. I can then take that string and do: t=sess.graph.get_tensor_by_name('import/mixed_5/tower_1/conv_1/Conv2D:0');foo=sess.run(t) figure();[(subplot(ceil(sqrt(foo.shape[-1])),ceil(sqrt(foo.shape[-1])),i+1), imshow(foo[0,:,:,i])) for i in range(foo.shape[-1])] This gives me images that look like convolution kernels, but this is a far cry from a tool that makes pictures like this: http://cs231n.github.io/assets/cnn/weights.jpeg – Ben Jul 03 '17 at 20:19

1 Answers1

0

This is related to this question - basically you can load it (like in the python image classification example) and then run get_operations() on the graph, which gives you a list of operations, each of which have a name and a type attribute. You also could in principle use tensorboard I believe, but for that specific graph I always ran into "too big" errors.

Community
  • 1
  • 1
etarion
  • 16,935
  • 4
  • 43
  • 66