Running following code
filename: uff1.py
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import tensorrt as trt
from tensorrt.parsers import uffparser
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
from random import randint # generate a random test case
from PIL import Image
from matplotlib.pyplot import imshow #to show test case
import time #import system tools
import os
import uff
uff_model = uff.from_tensorflow_frozen_model('./rcnn_3chan.pb', ['image_tensor','detection_scores','detection_boxes' ,'detection_classes' ,'num_detections'])
parser.register_output("image_tensor")
parser.register_output("detection_scores")
parser.register_output("detection_boxes")
parser.register_output("detection_classes")
parser.register_output("num_detections")
[/code]
my ENV in bashrc:
export PATH=$PATH:/usr/local/cuda-9.0/bin/:/home/fts/Downloads/TensorRT-3.0.4/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/fts/Downloads/TensorRT-3.0.4/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64:/usr/local/lib/x86_64-linux-gnu:/usr/local/cuda-9.0/lib64:/usr/local/lib/x86_64-linux-gnu
export CUDA_ROOT=/usr/local/cuda-9.0
export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda-9.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64
Error:
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
Using output node image_tensor
Using output node detection_scores
Using output node detection_boxes
Using output node detection_classes
Using output node num_detections
Converting to UFF graph
Warning: No conversion function registered for layer: Identity yet.
Converting as custom op Identity num_detections
name: "num_detections"
op: "Identity"
input: "SecondStagePostprocessor/ToFloat_1"
attr {
key: "T"
value {
type: DT_FLOAT
}
}
Warning: No conversion function registered for layer: Cast yet.
Converting as custom op Cast SecondStagePostprocessor/ToFloat_1
name: "SecondStagePostprocessor/ToFloat_1"
op: "Cast"
input: "SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/TensorArrayGatherV3"
attr {
key: "DstT"
value {
type: DT_FLOAT
}
}
attr {
key: "SrcT"
value {
type: DT_INT32
}
}
Warning: No conversion function registered for layer: TensorArrayGatherV3 yet.
Converting as custom op TensorArrayGatherV3 SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/TensorArrayGatherV3
name: "SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/TensorArrayGatherV3"
op: "TensorArrayGatherV3"
input: "SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/TensorArray_8"
input: "SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/range"
input: "SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/while/Exit_5"
attr {
key: "_class"
value {
list {
s: "loc:@SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/TensorArray_8"
}
}
}
attr {
key: "dtype"
value {
type: DT_INT32
}
}
attr {
key: "element_shape"
value {
shape {
}
}
}
Traceback (most recent call last):
File "uff1.py", line 19, in <module>
uff_model = uff.from_tensorflow_frozen_model('./rcnn_3chan.pb', ['image_tensor','detection_scores','detection_boxes' ,'detection_classes' ,'num_detections'])
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 103, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 75, in from_tensorflow
name="main")
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 64, in convert_tf2uff_graph
uff_graph, input_replacements)
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 51, in convert_tf2uff_node
op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes)
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 28, in convert_layer
fields = cls.parse_tf_attrs(tf_node.attr)
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 177, in parse_tf_attrs
for key, val in attrs.items()}
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 177, in <dictcomp>
for key, val in attrs.items()}
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 172, in parse_tf_attr_value
return cls.convert_tf2uff_field(code, val)
File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 161, in convert_tf2uff_field
if shp.unknown_rank:
AttributeError: 'google.protobuf.pyext._message.RepeatedCompositeCo' object has no attribute 'unknown_rank'