• TensorRT6.0.1: ERROR: builtin_op_importers.cpp:695 In function importBatchNormalization:


    [00/13/2020-21:46:09] [E] [TRT] (Unnamed Layer* 0) [Convolution]: at least 4 dimensions are required for input
    While parsing node number 1 [BatchNormalization]:
    ERROR: builtin_op_importers.cpp:695 In function importBatchNormalization:
    [6] Assertion failed: scale_weights.shape == weights_shape
    [00/13/2020-21:46:09] [E] Failed to parse onnx file
    [00/13/2020-21:46:09] [E] Parsing model failed
    [00/13/2020-21:46:09] [E] Engine could not be created

    看网上给的方案比较麻烦:https://github.com/NVIDIA/TensorRT/issues/330

    我这里的解决方案如下:

    第一步:更换createNetworkV2(1U)为createNetwork()

    完成第一步编译运行,如果还是没有结果,执行第二步:

    第二步:更换exeContexts[contextIndex]->enqueueV2(cur.data...)....为exeContexts[contextIndex]->enqueue(1, cur.data(), streams[contextIndex]->get(), nullptr);

    完成第二步应该就可以正常运行了,如果还有错,更改cmake中的算力,与你使用的GPU相匹配。

  • 相关阅读:
    android studio导出apk
    Android开发入门经典实例
    L1-Day32
    L1-Day33
    L1-Day30
    Oracle中的null与空字符串''的区别
    Oracle中的job(定时任务)
    Oracle中的加解密函数
    LeetCode33题——搜索旋转排序数组
    Oracle中的DBMS_LOCK包的使用
  • 原文地址:https://www.cnblogs.com/zhibei/p/13158380.html
Copyright © 2020-2023  润新知