on Ubuntu 16 I installed tensorrt 4.0.0.3 with cuda 9.0 , prepared the set of plugins for SSD and I was able to tun serialization and inference. I upgraded to 4.0.1.6 and cuda 9.2 and I cannot run serialization.
It seems isPlugin of pluginFactory is never called
These are the errors I get for different run of the same executable:
FIRST RUN
Building a GPU inference engine for FD-TRT.prototxt, N = 16 …
[libprotobuf ERROR google/protobuf/io/coded_stream.cc:207] A protocol message was rejected because it was too big (more than 0 bytes). To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
Weights for layer conv1_1 doesn’t exist
ERROR: CaffeParser: ERROR: Attempting to access NULL weights
Weights for layer conv1_1 doesn’t exist
ERROR: CaffeParser: ERROR: Attempting to access NULL weights
ERROR: Parameter check failed at: …/builder/Network.cpp::addConvolution::40, condition: kernelWeights.values != NULL
error parsing layer type Convolution index 0
NEXT RUN
Building a GPU inference engine for FD-TRT.prototxt, N = 16 …
could not parse layer type Normalize
PS. tensorrt samples run without error.
extract of the code:
IBuilder* builder = createInferBuilder(gLogger);
INetworkDefinition* network = builder->createNetwork();
ICaffeParser* parser = createCaffeParser();
parser->setPluginFactory(&pluginFactory);
bool useFp16 = builder->platformHasFastFp16();
DataType modelDataType = useFp16 ? DataType::kHALF : DataType::kFLOAT;
const IBlobNameToTensor *blobNameToTensor = parser->parse(deployFile.c_str(),
modelFile.c_str(),
*network,
modelDataType );
extract of the plugin factory:
class PluginFactory : public nvinfer1::IPluginFactory, public nvcaffeparser1::IPluginFactory
{
public:
virtual nvinfer1::IPlugin* createPlugin(const char* layerName, const nvinfer1::Weights* weights, int nbWeights) override;
IPlugin* createPlugin(const char* layerName, const void* serialData, size_t serialLength) override;
void(*nvPluginDeleter)(INvPlugin*) { [](INvPlugin* ptr) {ptr->destroy(); } };
bool isPlugin(const char* name) override;
void destroyPlugin();
//normalize layer
std::unique_ptr<INvPlugin, decltype(nvPluginDeleter)> mNormalizeLayer{ nullptr, nvPluginDeleter };
…
bool PluginFactory::isPlugin(const char* name)
{
std::cout<<“isPlugin “<<name<<”\n”;
return (!strcmp(name, “conv4_3_norm”)
|| !strcmp(name, “conv4_3_norm_mbox_conf_perm”)
|| !strcmp(name, “conv4_3_norm_mbox_conf_flat”)
|| !strcmp(name, “conv4_3_norm_mbox_loc_perm”)
|| !strcmp(name, “conv4_3_norm_mbox_loc_flat”)
|| !strcmp(name, “fc7_mbox_conf_perm”)
|| !strcmp(name, “fc7_mbox_conf_flat”)
|| !strcmp(name, “fc7_mbox_loc_perm”)
|| !strcmp(name, “fc7_mbox_loc_flat”)
…