Thanks again for your response!
I’ve tried step 1 above with the output shown below…seems similar as before, so I"m guessing that I need a config.py file to help with the Tensorflow to uff conversion. Unfortunately, I have no idea how to create this config.py file. I’ve searched the internet for an example, but not sure what I’m looking for. I appears that it should contain some GraphSurgeon commands, but not sure how to proceed.
My pb file is about 250MB, and I think the file attachment limit here is 10MB. I’ll try to share it from my Google Drive. Please try this link:
https://drive.google.com/file/d/19H_KpO96AKbC_M1m6Ex3f-l4TH0jtJnA/view?usp=sharing
Even if we get this part to work, I’m a little worried about step 2. Probably have to create a plugin or two for some of the layers. Regardless, first things first…step 1!
Here’s the output I got after executing step 1 above
command I used (note that there are 3 output nodes):
sudo python3 /usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py /home/bryan/face/frozen_model.pb -O filtered_detections/map/TensorArrayStack/TensorArrayGatherV3 filtered_detections/map/TensorArrayStack_1/TensorArrayGatherV3 filtered_detections/map/TensorArrayStack_2/TensorArrayGatherV3 -o /home/bryan/face/model.uff
Output:
2019-12-18 13:13:18.690970: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.0
/home/bryan/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/bryan/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING:tensorflow:From /usr/lib/python3.6/dist-packages/uff/converters/tensorflow/conversion_helpers.py:18: The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead.
Loading /home/bryan/face/frozen_model.pb
WARNING:tensorflow:From /usr/lib/python3.6/dist-packages/uff/converters/tensorflow/conversion_helpers.py:231: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.
NOTE: UFF has been tested with TensorFlow 1.12.0. Other versions are not guaranteed to work
WARNING: The version of TensorFlow installed on this system is not guaranteed to work with UFF.
WARNING:tensorflow:From /usr/lib/python3.6/dist-packages/graphsurgeon/_utils.py:2: The name tf.NodeDef is deprecated. Please use tf.compat.v1.NodeDef instead.
UFF Version 0.6.3
=== Automatically deduced input nodes ===
[name: "input_1"
op: "Placeholder"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "shape"
value {
shape {
dim {
size: -1
}
dim {
size: -1
}
dim {
size: -1
}
dim {
size: 3
}
}
}
}
]
=========================================
Using output node filtered_detections/map/TensorArrayStack/TensorArrayGatherV3
Converting to UFF graph
Warning: No conversion function registered for layer: TensorArrayGatherV3 yet.
Converting filtered_detections/map/TensorArrayStack/TensorArrayGatherV3 as custom op: TensorArrayGatherV3
WARNING:tensorflow:From /usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py:179: The name tf.AttrValue is deprecated. Please use tf.compat.v1.AttrValue instead.
Warning: No conversion function registered for layer: Exit yet.
Converting filtered_detections/map/while/Exit_2 as custom op: Exit
Warning: No conversion function registered for layer: Switch yet.
Converting filtered_detections/map/while/Switch_2 as custom op: Switch
Warning: No conversion function registered for layer: LoopCond yet.
Converting filtered_detections/map/while/LoopCond as custom op: LoopCond
Warning: No conversion function registered for layer: LogicalAnd yet.
Converting filtered_detections/map/while/LogicalAnd as custom op: LogicalAnd
Warning: No conversion function registered for layer: Less yet.
Converting filtered_detections/map/while/Less_1 as custom op: Less
Warning: No conversion function registered for layer: Enter yet.
Converting filtered_detections/map/while/Less/Enter as custom op: Enter
Warning: No conversion function registered for layer: Cast yet.
Converting clipped_boxes/Cast as custom op: Cast
Warning: No conversion function registered for layer: Tile yet.
Converting anchors_4/Tile as custom op: Tile
Warning: No conversion function registered for layer: Fill yet.
Converting anchors_4/meshgrid/ones as custom op: Fill
Warning: No conversion function registered for layer: Size yet.
Converting anchors_4/meshgrid/Size as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_4/Cast as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_4/arange as custom op: Range
Warning: No conversion function registered for layer: Size yet.
Converting anchors_4/meshgrid/Size_1 as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_4/Cast_1 as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_4/arange_1 as custom op: Range
Warning: No conversion function registered for layer: Tile yet.
Converting anchors_3/Tile as custom op: Tile
Warning: No conversion function registered for layer: Fill yet.
Converting anchors_3/meshgrid/ones as custom op: Fill
Warning: No conversion function registered for layer: Size yet.
Converting anchors_3/meshgrid/Size as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_3/Cast as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_3/arange as custom op: Range
Warning: No conversion function registered for layer: Size yet.
Converting anchors_3/meshgrid/Size_1 as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_3/Cast_1 as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_3/arange_1 as custom op: Range
Warning: No conversion function registered for layer: Tile yet.
Converting anchors_2/Tile as custom op: Tile
Warning: No conversion function registered for layer: Fill yet.
Converting anchors_2/meshgrid/ones as custom op: Fill
Warning: No conversion function registered for layer: Size yet.
Converting anchors_2/meshgrid/Size as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_2/Cast as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_2/arange as custom op: Range
Warning: No conversion function registered for layer: Size yet.
Converting anchors_2/meshgrid/Size_1 as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_2/Cast_1 as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_2/arange_1 as custom op: Range
Warning: No conversion function registered for layer: Tile yet.
Converting anchors_1/Tile as custom op: Tile
Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting P5_upsampled/resize/ResizeNearestNeighbor as custom op: ResizeNearestNeighbor
Warning: No conversion function registered for layer: Fill yet.
Converting anchors_1/meshgrid/ones as custom op: Fill
Warning: No conversion function registered for layer: Size yet.
Converting anchors_1/meshgrid/Size as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_1/Cast as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_1/arange as custom op: Range
Warning: No conversion function registered for layer: Size yet.
Converting anchors_1/meshgrid/Size_1 as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_1/Cast_1 as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_1/arange_1 as custom op: Range
Warning: No conversion function registered for layer: Tile yet.
Converting anchors_0/Tile as custom op: Tile
Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting P4_upsampled/resize/ResizeNearestNeighbor as custom op: ResizeNearestNeighbor
Warning: No conversion function registered for layer: Fill yet.
Converting anchors_0/meshgrid/ones as custom op: Fill
Warning: No conversion function registered for layer: Size yet.
Converting anchors_0/meshgrid/Size as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_0/Cast as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_0/arange as custom op: Range
Warning: No conversion function registered for layer: Size yet.
Converting anchors_0/meshgrid/Size_1 as custom op: Size
Warning: No conversion function registered for layer: Cast yet.
Converting anchors_0/Cast_1 as custom op: Cast
Warning: No conversion function registered for layer: Range yet.
Converting anchors_0/arange_1 as custom op: Range
Warning: No conversion function registered for layer: Merge yet.
Converting filtered_detections/map/while/Merge_1 as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting filtered_detections/map/while/NextIteration_1 as custom op: NextIteration
Warning: No conversion function registered for layer: Switch yet.
Converting filtered_detections/map/while/Switch as custom op: Switch
Warning: No conversion function registered for layer: Merge yet.
Converting filtered_detections/map/while/Merge as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting filtered_detections/map/while/NextIteration as custom op: NextIteration
Warning: No conversion function registered for layer: Enter yet.
Converting filtered_detections/map/while/Enter as custom op: Enter
Warning: No conversion function registered for layer: Switch yet.
Converting filtered_detections/map/while/Switch_1 as custom op: Switch
Warning: No conversion function registered for layer: Enter yet.
Converting filtered_detections/map/while/Enter_1 as custom op: Enter
Warning: No conversion function registered for layer: Less yet.
Converting filtered_detections/map/while/Less as custom op: Less
Warning: No conversion function registered for layer: Merge yet.
Converting filtered_detections/map/while/Merge_2 as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting filtered_detections/map/while/NextIteration_2 as custom op: NextIteration
Warning: No conversion function registered for layer: TensorArrayWriteV3 yet.
Converting filtered_detections/map/while/TensorArrayWrite/TensorArrayWriteV3 as custom op: TensorArrayWriteV3
Warning: No conversion function registered for layer: PadV2 yet.
Converting filtered_detections/map/while/PadV2 as custom op: PadV2
Warning: No conversion function registered for layer: TopKV2 yet.
Converting filtered_detections/map/while/TopKV2 as custom op: TopKV2
Warning: No conversion function registered for layer: GatherNd yet.
Converting filtered_detections/map/while/GatherNd_2 as custom op: GatherNd
Warning: No conversion function registered for layer: GatherNd yet.
Converting filtered_detections/map/while/GatherNd_1 as custom op: GatherNd
Warning: No conversion function registered for layer: NonMaxSuppressionV3 yet.
Converting filtered_detections/map/while/non_max_suppression/NonMaxSuppressionV3 as custom op: NonMaxSuppressionV3
Warning: No conversion function registered for layer: Where yet.
Converting filtered_detections/map/while/Where as custom op: Where
Warning: No conversion function registered for layer: Greater yet.
Converting filtered_detections/map/while/Greater as custom op: Greater
Warning: No conversion function registered for layer: TensorArrayReadV3 yet.
Converting filtered_detections/map/while/TensorArrayReadV3_1 as custom op: TensorArrayReadV3
Warning: No conversion function registered for layer: Enter yet.
Converting filtered_detections/map/while/TensorArrayReadV3_1/Enter_1 as custom op: Enter
Warning: No conversion function registered for layer: TensorArrayScatterV3 yet.
Converting filtered_detections/map/TensorArrayUnstack_1/TensorArrayScatter/TensorArrayScatterV3 as custom op: TensorArrayScatterV3
Warning: No conversion function registered for layer: TensorArrayV3 yet.
Converting filtered_detections/map/TensorArray_1 as custom op: TensorArrayV3
Warning: No conversion function registered for layer: Range yet.
Converting filtered_detections/map/TensorArrayUnstack_1/range as custom op: Range
Warning: No conversion function registered for layer: Enter yet.
Converting filtered_detections/map/while/TensorArrayReadV3_1/Enter as custom op: Enter
Traceback (most recent call last):
File "/usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py", line 93, in <module>
main()
File "/usr/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py", line 89, in main
debug_mode=args.debug
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 233, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 181, in from_tensorflow
debug_mode=debug_mode)
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 94, in convert_tf2uff_graph
uff_graph, input_replacements, debug_mode=debug_mode)
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 79, in convert_tf2uff_node
op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes, debug_mode=debug_mode)
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 41, in convert_layer
fields = cls.parse_tf_attrs(tf_node.attr)
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 222, in parse_tf_attrs
return {key: cls.parse_tf_attr_value(val) for key, val in attrs.items() if val is not None and val.WhichOneof('value') is not None}
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 222, in <dictcomp>
return {key: cls.parse_tf_attr_value(val) for key, val in attrs.items() if val is not None and val.WhichOneof('value') is not None}
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 218, in parse_tf_attr_value
return cls.convert_tf2uff_field(code, val)
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 190, in convert_tf2uff_field
return TensorFlowToUFFConverter.convert_tf2numpy_dtype(val)
File "/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py", line 103, in convert_tf2numpy_dtype
return tf.as_dtype(dtype).as_numpy_dtype
File "/home/bryan/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py", line 126, in as_numpy_dtype
return _TF_TO_NP[self._type_enum]
KeyError: 20