# TF to UFF issue

**URL:** <https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712>\
**Category:** TensorRT\
**Created:** [September 1, 2018, 8:56am UTC](https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712 "2018-09-01T08:56:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xhz](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@xhz](https://forums.developer.nvidia.com/u/xhz)\
**Post date:** [September 1, 2018, 8:56am UTC](https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712/1 "2018-09-01T08:56:29Z")

</div>

Hello,

I have a tf pb file, and I have found many convert issues, and remove ‘\_ResizeBilinear’, ‘\_BatchToSpaceND’ and ‘\_SpaceToBatchND’, but got below issue:

xhz@xhz-omen:tf\_to\_trt\_image\_classification$ python scripts/convert\_plan.py /home/xhz/Projects/models/xw\_model/new/LsGan\_model\_test.pb /home/xhz/Projects/models/xw\_model/LsGan\_model.pb.plan input\_img 360 640 sigmoid\_logits 1 0 float  
Using output node sigmoid\_logits  
Converting to UFF graph  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
WARNING: The UFF converter currently only supports 2D dilated convolutions  
No. nodes: 570  
UFF Output written to data/tmp.uff  
UFFParser: parsing input\_img  
UFFParser: parsing res\_aspp\_g/decoder/resnet/conv1/weights  
UFFParser: parsing res\_aspp\_g/decoder/resnet/conv1/conv1  
UFFParser: Convolution: add Padding Layer to support asymmetric padding  
UFFParser: Convolution: Left: 2  
UFFParser: Convolution: Right: 3  
UFFParser: Convolution: Top: 2  
UFFParser: Convolution: Bottom: 3  
UFFParser: parsing res\_aspp\_g/decoder/resnet/bn\_conv1/BatchNorm/Const  
UFFParser: parsing res\_aspp\_g/decoder/resnet/bn\_conv1/BatchNorm/beta  
UFFParser: parsing res\_aspp\_g/decoder/resnet/bn\_conv1/BatchNorm/Const\_1  
UFFParser: parsing res\_aspp\_g/decoder/resnet/bn\_conv1/BatchNorm/Const\_2  
UFFParser: parsing res\_aspp\_g/decoder/resnet/bn\_conv1/BatchNorm/FusedBatchNorm  
Parameter check failed at: Utils.cpp::reshapeWeights::71, condition: input.values != nullptr  
UFFParser: Parser error: res\_aspp\_g/decoder/resnet/bn\_conv1/BatchNorm/FusedBatchNorm: reshape weights failed!  
Failed to parse UFF

so i remove layer ‘FusedBatchNorm’, so got below issue:

UFFParser: parsing res\_aspp\_g/decoder/resnet/res4b3\_branch2a/weights  
UFFParser: parsing res\_aspp\_g/decoder/resnet/res4b3\_branch2a/Conv2D  
res\_aspp\_g/decoder/resnet/res4b1\_branch2b/convolution: at least three non-batch dimensions are required for input  
UFFParser: parsing res\_aspp\_g/decoder/resnet/res4b3\_branch2a/Relu  
UFFParser: parsing res\_aspp\_g/decoder/resnet/res4b3\_branch2b/weights  
UFFParser: parsing res\_aspp\_g/decoder/resnet/res4b3\_branch2b/convolution  
UFFParser: parsing res\_aspp\_g/decoder/resnet/res4b3\_branch2b/Relu  
UFFParser: parsing res\_aspp\_g/decoder/resnet/conv/weights  
UFFParser: parsing res\_aspp\_g/decoder/resnet/conv/Conv2D  
res\_aspp\_g/decoder/resnet/res4b1\_branch2b/Relu: at least one non-batch dimension is required for input  
UFFParser: parsing res\_aspp\_g/decoder/resnet/conv/biases  
UFFParser: parsing res\_aspp\_g/decoder/resnet/conv/BiasAdd  
res\_aspp\_g/decoder/resnet/res4b1\_branch2c/Conv2D: at least three non-batch dimensions are required for input  
UFFParser: Parser error: res\_aspp\_g/decoder/resnet/conv/BiasAdd: The input to the Scale Layer is required to have a minimum of 3 dimensions.  
Failed to parse UFF

---

<div class="post-metadata">

**Author:** ![xhz](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@xhz](https://forums.developer.nvidia.com/u/xhz)\
**Post date:** [September 1, 2018, 8:59am UTC](https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712/2 "2018-09-01T08:59:42Z")

</div>

I use the tool from [https://github.com/NVIDIA-Jetson/tf\_to\_trt\_image\_classification](https://github.com/NVIDIA-Jetson/tf_to_trt_image_classification), and the issue was post at [convert issue · Issue #26 · NVIDIA-AI-IOT/tf\_to\_trt\_image\_classification · GitHub](https://github.com/NVIDIA-Jetson/tf_to_trt_image_classification/issues/26)

Is TRT have some compatibility issue to tensorflow 1.8? Is someone have this issue?

My detail of computer:

OS: ubuntu 16.04 64bit(4.15.0-33-generic)  
NVIDIA GTX1080TI  
nvidia 384.130 + CUDA 9.0 + cudnn 7.1.2  
TensorRT 4.0.1.6

---

<div class="post-metadata">

**Author:** ![NVES](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nves/32/14043_2.png) [@NVES](https://forums.developer.nvidia.com/u/NVES)\
**Post date:** [September 10, 2018, 10:55pm UTC](https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712/3 "2018-09-10T22:55:26Z")

</div>

Hello,

It looks like you are converting a pb file with many TRT unsupported operations (ex: ResizeBilinear). Simply removing unsupported operations may not result in a valid model. Which is what you are seeing here. The TRT converter is calling out this out.

---

<div class="post-metadata">

**Author:** ![AndrewGong](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AndrewGong](https://forums.developer.nvidia.com/u/AndrewGong)\
**Post date:** [October 29, 2018, 2:58am UTC](https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712/4 "2018-10-29T02:58:17Z")

</div>

@NVES I meet the error. In my model, I use `slim.batch_norm`, it means tensorrt does not support this type of `FusedBatchNorm `op? how should I fix it?

---

<div class="post-metadata">

**Author:** ![AndrewGong](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AndrewGong](https://forums.developer.nvidia.com/u/AndrewGong)\
**Post date:** [November 13, 2018, 9:42am UTC](https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712/5 "2018-11-13T09:42:56Z")

</div>

@NVES when I use `tf.layer.batch_normalization` instead of `tf.slim.batch_norm`, meanwhile not setting the `training` parameter(the default value is False), it works. But when I train a model with setting the `training` parameter to `True`, then I transfer the `ckpt` model to `pb` and `uff` file and then parse the `uff` file, it stills shows the above error:

```auto
[TensorRT] INFO: UFFParser: parsing model_0/resnet_v1_50/conv1/batch_normalization/FusedBatchNorm
[TensorRT] ERROR: Parameter check failed at: Utils.cpp::reshapeWeights::71, condition: input.values != nullptr
[TensorRT] ERROR: UFFParser: Parser error: model_0/resnet_v1_50/conv1/batch_normalization/FusedBatchNorm: reshape weights failed!

```

it is weird issue, can you give some advises to fix it?

---

<div class="post-metadata">

**Author:** ![AndrewGong](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AndrewGong](https://forums.developer.nvidia.com/u/AndrewGong)\
**Post date:** [November 27, 2018, 3:20am UTC](https://forums.developer.nvidia.com/t/tf-to-uff-issue/64712/6 "2018-11-27T03:20:54Z")

</div>

see NVES’s suggestion [url][https://devtalk.nvidia.com/default/topic/1044545/tensorrt/-tf-slim-batch\_norm-or-tf-layer-batch\_normalization-/[/url]](https://devtalk.nvidia.com/default/topic/1044545/tensorrt/-tf-slim-batch_norm-or-tf-layer-batch_normalization-/%5B/url%5D)
