TensorRT 3 TX2 SSD crashed with Segmentation fault

Hi, AastaLLL,

I’m writing SSD on TX2 based on plugins within TensorRT 3.0. It crashed before conv4_3_norm_mbox_loc_perm with “Segmentation fault (core dumped)”, How can i fix it?

tail of the output
//=====================================================================================
[>>>>LAYER>>>>] conv4_3_norm isplugin 1
[>>>>LAYER>>>>] conv4_3_norm isplugin 1
[>>>>OUPUT>>>>] conv4_3_norm weights 512 0 1
13.2522 13.2542 13.2535 13.2536 13.2382 13.2538 13.25 13.2522 13.2539 13.2535
[>>>>LAYER>>>>] conv4_3_norm_mbox_loc isplugin 0
[>>>>LAYER>>>>] conv4_3_norm_mbox_loc_perm isplugin 1
[>>>>LAYER>>>>] conv4_3_norm_mbox_loc_perm isplugin 1
Segmentation fault (core dumped)
//=====================================================================================
Following are my code:
// =====================================================================================
else if (!strcmp(layerName, “conv4_3_norm”))
{
assert(mNormalize == nullptr);
assert((nbWeights != 0) && (weights != nullptr));
bool acrossSpatial = false;
bool channelShared = false;
float eps = 1e-5;
// scales → weights
mNormalize = std::unique_ptr<INvPlugin, decltype(nvPluginDeleter)>(createSSDNormalizePlugin(weights, acrossSpatial, channelShared, eps), nvPluginDeleter);
return mNormalize.get();
}

else if (!strcmp(layerName, “conv4_3_norm_mbox_loc_perm”))
{
assert(mConv4BLPermute == nullptr);
Quadruple permuteOrder = {{0, 2, 3, 1}};
mConv4BLPermute = std::unique_ptr<INvPlugin, decltype(nvPluginDeleter)>(createSSDPermutePlugin(permuteOrder), nvPluginDeleter);
return mConv4BLPermute.get();
}

Hi,

createSSDNormalizePlugin and createSSDPermutePlugin are not the official release functions.
We don’t have too much information to share with you.

Please refere to /usr/src/tensorrt/samples/sampleFasterRCNN/sampleFasterRCNN.cpp sample.
It demonstrates how to use a built-in createFasterRCNNPlugin plugin layer and can give you some information.
Ideally, set the required plugin layer in the factory should be enough.

class PluginFactory : public nvinfer1::IPluginFactory, public nvcaffeparser1::IPluginFactory
{
public:
        // deserialization plugin implementation
        virtual nvinfer1::IPlugin* createPlugin(const char* layerName, const nvinfer1::Weights* weights, int nbWeights) override
        {
                ... ...
                        mPluginRPROI = std::unique_ptr<INvPlugin, decltype(nvPluginDeleter)> (<b>createFasterRCNNPlugin</b>(...);
                ... ...
        }

        IPlugin* createPlugin(const char* layerName, const void* serialData, size_t serialLength) override
        {
                ... ...
                        mPluginRPROI = std::unique_ptr<INvPlugin, decltype(nvPluginDeleter)> (<b>createFasterRCNNPlugin</b>(serialData, serialLength), nvPluginDeleter);
                ... ...
        }
}

Thanks

Hi jiangshimiao1,

this error is probably due to non-supported layers, coming further in SSD pipeline. Once you call all the non-supported layers with proper Plugin API implementation, this wont appear.

I hope this helps !