TensorRT v6 documentation claims that ResizeNearestNeighbor is supported on TensorFlow.
ref: https://docs.nvidia.com/deeplearning/sdk/tensorrt-archived/tensorrt-601/tensorrt-support-matrix/index.html
However, it isn’t supported.
[Platform details]
Linux distro and version: Ubuntu 18.04.2 LTS
GPU type: GeForce GTX 1080 Ti
nvidia driver version: 410.72
CUDA version: 10.0.130
CUDNN version: 7.6.0.64
Python version [if using python]: 3.6.8
Tensorflow version: 1.13.2
TensorRT version: debian packages with 6.0.1-1+cuda10.0
in nv-tensorrt-repo-ubuntu1804-cuda10.0-trt6.0.1.5-ga-20190913_1-1_amd64
import tensorflow as tf
import tensorrt as trt
import uff
TRT_LOGGER = trt.Logger(trt.Logger.Severity.INFO)
graph = tf.Graph()
with graph.as_default():
input_tensor = tf.placeholder(tf.float32, [1, 16, 16, 3], name='input')
# [1, 16, 16, 3] -> [1, 32, 32, 3]
resized = tf.image.resize_nearest_neighbor(input_tensor, size=[32, 32], name='output')
UFF_PATH = '/tmp/test_resize.uff'
serialized_uff = uff.from_tensorflow(output_filename=UFF_PATH,
output_nodes=['output'],
quiet=False,
text=False,
graphdef=graph.as_graph_def())
with trt.Builder(TRT_LOGGER) as builder:
with builder.create_network() as network:
uff_parser = trt.UffParser()
uff_parser.register_input('input', [16, 16, 3])
uff_parser.register_output('output')
uff_parser.parse(UFF_PATH, network)
Observed:
Using output node output
Converting to UFF graph
Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting output as custom op: ResizeNearestNeighbor
DEBUG [/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py:96] Marking ['output'] as outputs
No. nodes: 4
UFF Output written to /tmp/test_resize.uff
[TensorRT] ERROR: UffParser: Validator error: output: Unsupported operation _ResizeNearestNeighbor