Error about graphsurgeon

I’m in the process of converting a .pb file into a .bin file.

I have this error:

AttributeError: ‘NoneType’ object has no attribute ‘serialize’

So I added that function.

def replace_fusedbnv3(graph):
“”“Replace all ‘FusedBatchNormV3’ in the graph with ‘FusedBatchNorm’.
NOTE: ‘FusedBatchNormV3’ is not supported by UFF parser.
https://devtalk.nvidia.com/default/topic/1066445/tensorrt/tensorrt-6-0-1-tensorflow-1-14-no-conversion-function-registered-for-layer-fusedbatchnormv3-yet/post/5403567/#5403567
“””
for node in graph.find_nodes_by_op(‘FusedBatchNormV3’):
gs.update_node(node, op=‘FusedBatchNorm’)
return graph

Then this error occurred.:

Traceback (most recent call last): File “build_engine.py”, line 240, in main() File “build_engine.py”, line 217, in main dynamic_graph = replace_fusedbnv3(dynamic_graph) File “build_engine.py”, line 195, in replace_fusedbnv3 gs.update_node(node, op=‘FusedBatchNorm’) AttributeError: module ‘graphsurgeon’ has no attribute ‘update_node’

Research has shown that it is because the tensorrt api is the seventh version of tensorrt.

  1. Is there a separate solution for the above errors?
    2.Where can I see api for tensorrt 5.x?

Hi,

FusedBatchNormV3 is not supported by TensorRT yet.
You can update the config to use FusedBatchNorm instead.

def preprocess(dynamic_graph):
    ...
    # Rename the FusedBatchNormV3 op to FusedBatchNorm (will be fixed in TRT 7.1)
    fusedbatchnorm_nodes = dynamic_graph.find_nodes_by_op("FusedBatchNormV3")
    for node in fusedbatchnorm_nodes:
        node.op = "FusedBatchNorm"

Here is the document of all the TensorRT version for your reference:
https://docs.nvidia.com/deeplearning/sdk/tensorrt-archived/index.html

Thanks.