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.
Asked
Active
Viewed 1,318 times
1
-
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 Answers
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.
-
I'm getting the operation name, input and output. How do I use this so I can recreate parts of the graph again? – n00b Feb 17 '16 at 08:20
-
here's example of recreating the graph: https://github.com/tensorflow/tensorflow/issues/554 – Yaroslav Bulatov Feb 17 '16 at 17:45