Commit 48405526 authored by Ashwin Bharambe's avatar Ashwin Bharambe Committed by Facebook Github Bot

Allow printing net even when output blobs are absent

Reviewed By: rbgirshick

Differential Revision: D7491769

fbshipit-source-id: 20d8d1f72a773379a3882b697b574b0b0b4f01d3
parent 1d677500
......@@ -222,7 +222,14 @@ def print_net(model, namescope='gpu_0'):
if output_name.find('grad') >= 0 or output_name.find('__m') >= 0:
continue
output_shape = workspace.FetchBlob(output_name).shape
try:
# Under some conditions (e.g., dynamic memory optimization)
# it is possible that the network frees some blobs when they are
# no longer needed. Handle this case...
output_shape = workspace.FetchBlob(output_name).shape
except BaseException:
output_shape = '<unknown>'
first_blob = True
op_label = op_type + (op_name if op_name == '' else ':' + op_name)
suffix = ' ------- (op: {})'.format(op_label)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment