首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用tensorRT运行deeplab v3+

使用tensorRT运行deeplab v3+
EN

Stack Overflow用户
提问于 2018-11-15 21:43:36
回答 2查看 1.4K关注 0票数 2

我正在尝试使用tensorRT优化deeplab v3+模型,我得到了以下错误:

代码语言:javascript
复制
    UFF Version 0.5.5
=== Automatically deduced input nodes ===
[name: "ImageTensor"
op: "Placeholder"
attr {
  key: "_output_shapes"
  value {
    list {
      shape {
        dim {
          size: 1
        }
        dim {
          size: -1
        }
        dim {
          size: -1
        }
        dim {
          size: 3
        }
      }
    }
  }
}
attr {
  key: "dtype"
  value {
    type: DT_UINT8
  }
}
attr {
  key: "shape"
  value {
    shape {
      dim {
        size: 1
      }
      dim {
        size: -1
      }
      dim {
        size: -1
      }
      dim {
        size: 3
      }
    }
  }
}
]
=========================================

=== Automatically deduced output nodes ===
[name: "Squeeze_1"
op: "Squeeze"
input: "resize_images/ResizeNearestNeighbor"
attr {
  key: "T"
  value {
    type: DT_INT64
  }
}
attr {
  key: "_output_shapes"
  value {
    list {
      shape {
        dim {
          size: 1
        }
        dim {
          size: -1
        }
        dim {
          size: -1
        }
      }
    }
  }
}
attr {
  key: "squeeze_dims"
  value {
    list {
      i: 3
    }
  }
}
]
==========================================

Using output node Squeeze_1
Converting to UFF graph
Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting resize_images/ResizeNearestNeighbor as custom op: ResizeNearestNeighbor
Warning: No conversion function registered for layer: ExpandDims yet.
Converting ExpandDims_1 as custom op: ExpandDims
Warning: No conversion function registered for layer: Slice yet.
Converting Slice as custom op: Slice
Warning: No conversion function registered for layer: ArgMax yet.
Converting ArgMax as custom op: ArgMax
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting ResizeBilinear_2 as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting ResizeBilinear_1 as custom op: ResizeBilinear
Traceback (most recent call last):
  File "c:\users\iariav\anaconda3\envs\tensorflow\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\iariav\anaconda3\envs\tensorflow\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\iariav\Anaconda3\envs\tensorflow\Scripts\convert-to-uff.exe\__main__.py", line 9, in <module>
  File "c:\users\iariav\anaconda3\envs\tensorflow\lib\site-packages\uff\bin\convert_to_uff.py", line 89, in main
    debug_mode=args.debug
  File "c:\users\iariav\anaconda3\envs\tensorflow\lib\site-packages\uff\converters\tensorflow\conversion_helpers.py", line 187, in from_tensorflow_frozen_model
    return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
  File "c:\users\iariav\anaconda3\envs\tensorflow\lib\site-packages\uff\converters\tensorflow\conversion_helpers.py", line 157, in from_tensorflow
    debug_mode=debug_mode)
  File "c:\users\iariav\anaconda3\envs\tensorflow\lib\site-packages\uff\converters\tensorflow\converter.py", line 94, in convert_tf2uff_graph
    uff_graph, input_replacements, debug_mode=debug_mode)
  File "c:\users\iariav\anaconda3\envs\tensorflow\lib\site-packages\uff\converters\tensorflow\converter.py", line 72, in convert_tf2uff_node
    inp_node = tf_nodes[inp_name]
KeyError: 'logits/semantic/biases/read'

据我所知,这是由uff转换器不支持的某些层造成的吗?有没有人成功地将deeplab模型转换为uff?我在tensorflow中使用了原始的deeplabv3+模型。

谢谢

EN

回答 2

Stack Overflow用户

发布于 2018-11-20 19:10:54

是的,由于层的支持,有时候让一个特定的模型在TensorRT中工作会有点棘手。对于新的TensorRT 5GA,以下是受支持的层(取自开发人员指南):

问你,你可以看到你有一些层,如ResizeNearestNeighborResizeBilinearArgMax,你最好的方法,我最终做的是将网络移植到某个点,并使用cpp创建我需要的层。检查IPluginV2和IPluginCreator,看看是否可以自己实现这些层。

我认为随着时间的推移,会推出更多的层支持,但我猜如果你等不及了,那就自己试一试吧。

票数 0
EN

Stack Overflow用户

发布于 2020-01-31 14:55:40

我已经使用TF-TRT在Jetson Nano上运行了deeplabv3+模型。根据TensorRT发行说明

Caffe解析器和UFF解析器的

弃用-我们正在TensorRT 7中弃用Caffe解析器和UFF解析器。它们将在TensorRT 8的下一个主要版本中进行测试和功能,但我们计划在后续的主要版本中删除对它们的支持。计划迁移您的工作流以使用tf2onnx、keras2onnx或TensorFlow-TensorRT (TF-TRT)进行部署。

使用TF-TRT,我可以得到优化的TensorRT图,即使在对我的数据集进行重新训练之后,它也可以成功地运行。

此外,如果您使用的版本不支持某些运算符,那么对于这些特定的运算符,执行回退到tensorflow。这意味着在执行中不会有任何错误,只是优化的程度会更低。

参考文献:

https://docs.nvidia.com/deeplearning/frameworks/tf-trt-user-guide/index.html#integrate-ovr

  1. TF-TRT用户指南
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53320823

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档