TensorRT  5.1.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
nvcaffeparser1::ICaffeParser Class Referenceabstract

Class used for parsing Caffe models. More...

#include <NvCaffeParser.h>

Public Member Functions

virtual const IBlobNameToTensorparse (const char *deploy, const char *model, nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType)=0
 Parse a prototxt file and a binaryproto Caffe model to extract network configuration and weights associated with the network, respectively. More...
 
virtual const IBlobNameToTensorparseBuffers (const char *deployBuffer, std::size_t deployLength, const char *modelBuffer, std::size_t modelLength, nvinfer1::INetworkDefinition &network, nvinfer1::DataType weightType)=0
 Parse a deploy prototxt a binaryproto Caffe model from memory buffers to extract network configuration and weights associated with the network, respectively. More...
 
virtual IBinaryProtoBlobparseBinaryProto (const char *fileName)=0
 Parse and extract data stored in binaryproto file. More...
 
virtual void setProtobufBufferSize (size_t size)=0
 Set buffer size for the parsing and storage of the learned model. More...
 
virtual void setPluginFactory (IPluginFactory *factory)=0
 Set the IPluginFactory used to create the user defined plugins. More...
 
virtual void setPluginFactoryExt (IPluginFactoryExt *factory)=0
 Set the IPluginFactoryExt used to create the user defined pluginExts. More...
 
virtual void destroy ()=0
 Destroy this ICaffeParser object.
 
virtual void setPluginFactoryV2 (IPluginFactoryV2 *factory)=0
 Set the IPluginFactoryV2 used to create the user defined pluginV2 objects. More...
 
virtual void setPluginNamespace (const char *libNamespace)=0
 Set the namespace used to lookup and create plugins in the network.
 

Detailed Description

Class used for parsing Caffe models.

Allows users to export models trained using Caffe to TRT.

Warning
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.

Member Function Documentation

virtual const IBlobNameToTensor* nvcaffeparser1::ICaffeParser::parse ( const char *  deploy,
const char *  model,
nvinfer1::INetworkDefinition network,
nvinfer1::DataType  weightType 
)
pure virtual

Parse a prototxt file and a binaryproto Caffe model to extract network configuration and weights associated with the network, respectively.

Parameters
deployThe plain text, prototxt file used to define the network configuration.
modelThe binaryproto Caffe model that contains the weights associated with the network.
networkNetwork in which the CaffeParser will fill the layers.
weightTypeThe type to which the weights will transformed.
Returns
A pointer to an IBlobNameToTensor object that contains the extracted data.
See Also
nvcaffeparser1::IBlobNameToTensor
virtual IBinaryProtoBlob* nvcaffeparser1::ICaffeParser::parseBinaryProto ( const char *  fileName)
pure virtual

Parse and extract data stored in binaryproto file.

The binaryproto file contains data stored in a binary blob. parseBinaryProto() converts it to an IBinaryProtoBlob object which gives the user access to the data and meta-data about data.

Parameters
fileNamePath to file containing binary proto.
Returns
A pointer to an IBinaryProtoBlob object that contains the extracted data.
See Also
nvcaffeparser1::IBinaryProtoBlob
virtual const IBlobNameToTensor* nvcaffeparser1::ICaffeParser::parseBuffers ( const char *  deployBuffer,
std::size_t  deployLength,
const char *  modelBuffer,
std::size_t  modelLength,
nvinfer1::INetworkDefinition network,
nvinfer1::DataType  weightType 
)
pure virtual

Parse a deploy prototxt a binaryproto Caffe model from memory buffers to extract network configuration and weights associated with the network, respectively.

Parameters
deployBufferThe plain text deploy prototxt used to define the network configuration.
deployLengthThe length of the deploy buffer.
modelBufferThe binaryproto Caffe memory buffer that contains the weights associated with the network.
modelLengthThe length of the model buffer.
networkNetwork in which the CaffeParser will fill the layers.
weightTypeThe type to which the weights will transformed.
Returns
A pointer to an IBlobNameToTensor object that contains the extracted data.
See Also
nvcaffeparser1::IBlobNameToTensor
virtual void nvcaffeparser1::ICaffeParser::setPluginFactory ( IPluginFactory factory)
pure virtual

Set the IPluginFactory used to create the user defined plugins.

Parameters
factoryPointer to an instance of the user implmentation of IPluginFactory.
virtual void nvcaffeparser1::ICaffeParser::setPluginFactoryExt ( IPluginFactoryExt factory)
pure virtual

Set the IPluginFactoryExt used to create the user defined pluginExts.

Parameters
factoryPointer to an instance of the user implmentation of IPluginFactoryExt.
virtual void nvcaffeparser1::ICaffeParser::setPluginFactoryV2 ( IPluginFactoryV2 factory)
pure virtual

Set the IPluginFactoryV2 used to create the user defined pluginV2 objects.

Parameters
factoryPointer to an instance of the user implmentation of IPluginFactoryV2.
virtual void nvcaffeparser1::ICaffeParser::setProtobufBufferSize ( size_t  size)
pure virtual

Set buffer size for the parsing and storage of the learned model.

Parameters
sizeThe size of the buffer specified as the number of bytes.
Note
Default size is 2^30 bytes.

The documentation for this class was generated from the following file: