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.
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 “”, line 240, in main() File “”, line 217, in main dynamic_graph = replace_fusedbnv3(dynamic_graph) File “”, 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?


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: