# Error in converting frozen graph to Tensor RT engine

**URL:** <https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149>\
**Category:** Jetson AGX Xavier\
**Created:** [June 27, 2019, 10:58am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149 "2019-06-27T10:58:48Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![miteshp.patel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@miteshp.patel](https://forums.developer.nvidia.com/u/miteshp.patel)\
**Post date:** [June 27, 2019, 10:58am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/1 "2019-06-27T10:58:48Z")

</div>

Hello,

I am following this [GitHub - NVIDIA-AI-IOT/tf\_to\_trt\_image\_classification: Image classification with NVIDIA TensorRT from TensorFlow models.](https://github.com/NVIDIA-AI-IOT/tf_to_trt_image_classification) link for my Xavier for Tensorflow to Tensor RT image classification.

I have installed Jetpack 4.2 which included Tensor RT 5.0.6.

I got the uff error which I solved by downloading tar file “TensorRT-5.0.2.6.Ubuntu-18.04.1.x86\_64-gnu.cuda-10.0.cudnn7.3” and installed wheel package for uff.

Also installed graphsurgeon wheel package from same tar file.

I am able to create frozen graphs.

But I get error in converting frozen graph to Tensor RT engine or Plan file.

I fired following command from root path of project:

python scripts/convert\_plan.py data/frozen\_graphs/mobilenet\_v1\_1p0\_224.pb data/plans/mobilenet.plan input 224 224 MobilenetV1/Logits/SpatialSqueeze 1 0 half

I got following error:

Using output node MobilenetV1/Logits/SpatialSqueeze  
Converting to UFF graph  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_13\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_13\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_12\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_12\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_11\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_11\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_10\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_10\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_9\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_9\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_8\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_8\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_7\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_7\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_6\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_6\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_5\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_5\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_4\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_4\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_3\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_3\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_2\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_2\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_1\_pointwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_1\_depthwise/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
Warning: No conversion function registered for layer: FusedBatchNormV3 yet.  
Converting MobilenetV1/MobilenetV1/Conv2d\_0/BatchNorm/FusedBatchNormV3 as custom op: FusedBatchNormV3  
No. nodes: 306  
UFF Output written to data/tmp.uff  
UFFParser: Validator error: MobilenetV1/MobilenetV1/Conv2d\_13\_depthwise/BatchNorm/FusedBatchNormV3: Unsupported operation \_FusedBatchNormV3  
Failed to parse UFF

Also, I have tried another model “resnet\_v1\_50” in which I got the same error.

Please help me with this.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [June 28, 2019, 6:53am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/2 "2019-06-28T06:53:51Z")

</div>

Hi,

Usually, mobilenet requires a custom config.py file.  
We have a sample for ssd\_mobilenet\_v1. Would you mind to check if this sample fix your issue first?  
[url][https://github.com/AastaNV/TRT\_object\_detection[/url]](https://github.com/AastaNV/TRT_object_detection%5B/url%5D)

Thanks.

---

<div class="post-metadata">

**Author:** ![miteshp.patel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@miteshp.patel](https://forums.developer.nvidia.com/u/miteshp.patel)\
**Post date:** [June 28, 2019, 9:20am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/3 "2019-06-28T09:20:46Z")

</div>

Hello @AastaLL

Thanks for reponse.

I followed steps in link.

I got following error while running: python main.py car.jpg

Traceback (most recent call last):  
File “main.py”, line 23, in   
TRT\_LOGGER = trt.Logger(trt.Logger.INFO)  
AttributeError: module ‘tensorrt’ has no attribute ‘Logger’

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 3, 2019, 8:40am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/4 "2019-07-03T08:40:47Z")

</div>

Hi,

Please execute it with python3.

Like:

```auto
python3 main.py car.jpg

```

Thanks.

---

<div class="post-metadata">

**Author:** ![miteshp.patel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@miteshp.patel](https://forums.developer.nvidia.com/u/miteshp.patel)\
**Post date:** [July 3, 2019, 11:13am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/5 "2019-07-03T11:13:44Z")

</div>

I have tried :

python3 main.py car.jpg

I have tried importing on python shell of Tensor RT versions :5.0.6 and 5.1.5

import tensorflow.contrib.tensorrt as trt  
TRT\_LOGGER = trt.Logger(trt.Logger.INFO)

But this “AttributeError: module ‘tensorrt’ has no attribute ‘Logger’” error still persists.

I have checked Tensor RT versions using : dpkg -l | grep nvinfer

Please help me.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 4, 2019, 2:10am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/6 "2019-07-04T02:10:17Z")

</div>

Hi,

Do you use Jeston Xavier?

If yes, please install all the package with JetPack4.2.  
TensorRT5.1.5 is not available for Jeston yet.

Thanks.

---

<div class="post-metadata">

**Author:** ![miteshp.patel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@miteshp.patel](https://forums.developer.nvidia.com/u/miteshp.patel)\
**Post date:** [July 4, 2019, 2:20am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/7 "2019-07-04T02:20:50Z")

</div>

I have Jetpack 4.2 installed on Jetson Xavier. Its Tensor RT version is 5.0.6.

Also, I installed Tensor RT 5.1.5 on my PC with ubuntu 18.04 and tried the same.

But on both platform I got the same error.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 5, 2019, 3:38am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/8 "2019-07-05T03:38:41Z")

</div>

Hi,

Sorry for the missing.

This sample requires pure TensorRT package rather than TF-TRT.  
So you will need to import TensorRT like this :

```auto
import tensorrt as trt

```

Don’t use the one from the tensorflow.contrib.  
Thanks.

---

<div class="post-metadata">

**Author:** ![miteshp.patel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@miteshp.patel](https://forums.developer.nvidia.com/u/miteshp.patel)\
**Post date:** [July 5, 2019, 3:46am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/9 "2019-07-05T03:46:49Z")

</div>

Hello I have tried following on python shell.

import tensorrt as trt  
TRT\_LOGGER = trt.Logger(trt.Logger.INFO)

But still it throws same error.

AttributeError: module ‘tensorrt’ has no attribute ‘Logger’"

---

<div class="post-metadata">

**Author:** ![snarky](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/snarky/32/10446_2.png) [@snarky](https://forums.developer.nvidia.com/u/snarky)\
**Post date:** [July 5, 2019, 5:28am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/10 "2019-07-05T05:28:52Z")

</div>

It seems likely that the runtime optimized tensorflow doesn’t have a logger.  
You might want to import a Logger from somewhere else, or write an interface that implements whatever you need the Logger for.  
(In general, during inference, you don’t want to log anything at runtime, because doing so will consume more resources and can reduce frame rate.)  
Or just replace your Logger calls with print statements.

---

<div class="post-metadata">

**Author:** ![miteshp.patel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@miteshp.patel](https://forums.developer.nvidia.com/u/miteshp.patel)\
**Post date:** [July 5, 2019, 7:13am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/11 "2019-07-05T07:13:41Z")

</div>

Hi @snarky

I am using Tensor RT Logger and not Tensorflow. Actually I am getting error for many functions like: Logger, Builder and DataType. I get same error for all these.

@AastaLLL  
I have created sample.py containing these two lines but still getting errors:

import tensorrt as trt  
TRT\_LOGGER = trt.Logger(trt.Logger.INFO)

Also, I have tried to run sample “tensorrt/samples/python/uff\_ssd”

I fired command :

python detect\_objects.py images/image2.jpg

It throws errors:  
Traceback (most recent call last):  
File “detect\_objects.py”, line 11, in   
import utils.inference as inference\_utils # TRT/TF inference wrappers  
File “/usr/src/tensorrt/samples/python/uff\_ssd/utils/inference.py”, line 13, in   
import utils.engine as engine\_utils # TRT Engine creation/save/load utils  
File “/usr/src/tensorrt/samples/python/uff\_ssd/utils/engine.py”, line 9, in   
from utils.model import ModelData  
File “/usr/src/tensorrt/samples/python/uff\_ssd/utils/model.py”, line 12, in   
from utils.paths import PATHS  
File “/usr/src/tensorrt/samples/python/uff\_ssd/utils/paths.py”, line 7, in   
class Paths(object):  
File “/usr/src/tensorrt/samples/python/uff\_ssd/utils/paths.py”, line 56, in Paths  
def get\_engine\_path(self, inference\_type=trt.DataType.FLOT, max\_batch\_size=1):  
AttributeError: module ‘tensorrt’ has no attribute ‘DataType’

---

<div class="post-metadata">

**Author:** ![miteshp.patel](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@miteshp.patel](https://forums.developer.nvidia.com/u/miteshp.patel)\
**Post date:** [July 11, 2019, 6:48am UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/12 "2019-07-11T06:48:42Z")

</div>

I solved the problem. What I have done is:

I have removed Tensorflow 1.13 and installed 1.12. I deleted all the virtual environment. Made No changes to Jetpack 4.2 and its Tensor RT versions.

But still I could not find what was the issue.

Thanks

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 18, 2021, 6:24pm UTC](https://forums.developer.nvidia.com/t/error-in-converting-frozen-graph-to-tensor-rt-engine/77149/13 "2021-10-18T18:24:20Z")

</div>


