Open mrgloom opened 5 years ago
I have ended with layers after prediction_layers
scope, looks like it's maximum that tf-coreml can support in terms of operations.
I can't figure out how to get tensor names in tensorboard, so I have added print to get tensor names and the run python save.py
:
for i in range(len(box_encodings)):
print('DEBUG: box_encodings[i]', box_encodings[i])
for i in range(len(class_predictions_with_background)):
print('DEBUG: class_predictions_with_background[i]', class_predictions_with_background[i])
Here in the code: https://github.com/TropComplique/FaceBoxes-tensorflow/blob/545ec4f4f3c55c3592ee189ed56a11a3fd017194/src/detector.py#L284
# V1: after feature extractor
# [None, None, None, 128], [None, None, None, 256], [None, None, None, 256]
# output_node_names = ['inception3/concat', 'conv3_2/Relu', 'conv4_2/Relu']
# V2: real netwrok outputs
# ValueError: Graph has cycles.
# output_node_names = ['boxes', 'scores', 'num_boxes']
# V3: before NMS
# NotImplementedError: Unsupported Ops of type: Unpack,Pack
# [batch_size, num_anchors, 4], [batch_size, num_anchors]
# output_node_names = ['postprocessing/clip_by_value_1', 'postprocessing/strided_slice_2']
# V4: after reshaping scope
# AssertionError: Reshape: Currently only supported if target shape is rank 2, 3 or 4
# output_node_names = ['reshaping/concat', 'reshaping/concat_1']
# V5: after prediction_layers scope
output_node_names = ['prediction_layers/box_encoding_predictor_0/BiasAdd',
'prediction_layers/box_encoding_predictor_1/BiasAdd',
'prediction_layers/box_encoding_predictor_2/BiasAdd',
'prediction_layers/class_predictor_0/BiasAdd',
'prediction_layers/class_predictor_1/BiasAdd',
'prediction_layers/class_predictor_2/BiasAdd']
For 256x256 input image shapes of output tensors are:
------------------------------------------------------------
str(op.name) image_tensor
len(op.values()) 1
op.values()[i].get_shape().as_list() [None, 256, 256, 3]
------------------------------------------------------------
str(op.name) prediction_layers/box_encoding_predictor_0/BiasAdd
len(op.values()) 1
op.values()[i].get_shape().as_list() [None, 8, 8, 84]
------------------------------------------------------------
str(op.name) prediction_layers/class_predictor_0/BiasAdd
len(op.values()) 1
op.values()[i].get_shape().as_list() [None, 8, 8, 42]
------------------------------------------------------------
str(op.name) prediction_layers/box_encoding_predictor_1/BiasAdd
len(op.values()) 1
op.values()[i].get_shape().as_list() [None, 4, 4, 4]
------------------------------------------------------------
str(op.name) prediction_layers/class_predictor_1/BiasAdd
len(op.values()) 1
op.values()[i].get_shape().as_list() [None, 4, 4, 2]
------------------------------------------------------------
str(op.name) prediction_layers/box_encoding_predictor_2/BiasAdd
len(op.values()) 1
op.values()[i].get_shape().as_list() [None, 2, 2, 4]
------------------------------------------------------------
str(op.name) prediction_layers/class_predictor_2/BiasAdd
len(op.values()) 1
op.values()[i].get_shape().as_list() [None, 2, 2, 2]
I'm trying to find out endpoints of model like is done here: https://github.com/tf-coreml/tf-coreml/blob/master/examples/ssd_example.ipynb
Cause using default input/output node names produce error:
On graph last block before
nms
ispreprocessing
, but I'm not sure what isoutput_tensor_names
should be used.I have tried to print node dimensions:
Output:
But I can't find out any meaningfull node name:
These looks like bboxes:
Is it true that for 256x256 image we have 1364 bboxes?
With same approach I found node:
But not sure why it have shape
[None, None, 2]
?Also here is
postprocessing
scope: https://github.com/TropComplique/FaceBoxes-tensorflow/blob/545ec4f4f3c55c3592ee189ed56a11a3fd017194/src/detector.py#L70It should have output boxes with
[batch_size, num_anchors, 4]
shape and scores with[batch_size, num_anchors]
shape.