How to get weights in a Tensor?

  1. Tensorflow Pretrained model
  2. After parsed a .pb model to uff format
  3. How can I get weights in a tensor ? like output tensor
IBuilder* builder = createInferBuilder(gLogger);
    INetworkDefinition* network = builder->createNetwork();

#if 1
    if (!parser->parse(uffFile, *network, nvinfer1::DataType::kFLOAT))
        RETURN_AND_LOG(nullptr, ERROR, "Fail to parse");
    if (!parser->parse(uffFile, *network, nvinfer1::DataType::kHALF))
        RETURN_AND_LOG(nullptr, ERROR, "Fail to parse");
    // print some information
    auto output_tensor = network->getOutput(0);
    std::cout << "Tensor name " << output_tensor->getName() << std::endl;
<b>    //Actually , I wonna get ouput weights here , is that possible?</b>


As far as I know, I don’t think iTensor class has weight info.


Have you got weights data successfully? I need to get some layer’s weights data in my Caffe model too