tensorflow: TensorRT integration doesn't optimize conv2d_transpose

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes.
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04
  • TensorFlow installed from (source or binary): Source. Build toward TensorRT 3.0.4.
  • TensorFlow version (use command below): 1.7
  • Python version: 2.7.12
  • Bazel version (if compiling from source): 0.11.1
  • GCC/Compiler version (if compiling from source): 5.4.0
  • CUDA/cuDNN version: CUDA 9.0, cuDNN 7.1.4
  • GPU model and memory: NVIDIA 1080 Ti
  • Exact command to reproduce: First train a example model use mnist_conv_deconv.py Then use tensorflow built-in tools to freeze the graph:
python -m tensorflow.python.tools.freeze_graph --input_graph log/graph.pbtxt --input_checkpoint log/model.ckpt-20000 --output_node_names L2Loss --output_graph log/freeze_graph.pb

Finally use tensorrt.py to optimize the graph use TensorRT engine.

Describe the problem

The original graph contains 4 convolution and 4 deconvolution layers. snipaste_2018-06-20_12-39-15

After optimizing, convolution layers was converted into trt_op (successfully optimized by TensorRT), while all deconvolution layers (conv2d_transpose) remains unchanged. snipaste_2018-06-20_12-39-46

I think TensorRT support deconvolution as shown in their official guide TensorRT Developer Guide

TensorFlow The following list describes the operations that are supported in a TensorFlow framework. Placeholder Const Add, Sub, Mul, Div, Minimum and Maximum BiasAdd Negative, Abs, Sqrt, Rsqrt, Pow, Exp and Log FusedBatchNorm ReLU, TanH, Sigmoid SoftMax Mean ConcatV2 Reshape Transpose Conv2D DepthwiseConv2dNative ConvTranspose2D MaxPool AvgPool Pad is supported if followed by one of these TensorFlow layers: Conv2D, DepthwiseConv2dNative, MaxPool, and AvgPool

So is there any problem in tensorflow integrations?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 25 (13 by maintainers)

Most upvoted comments

I ran your script with PR #20350 built with TRT 4.0.1.6, I think all conv layers are now converted: 0oym5krjj7d