Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

exception throw when loading face reidentification model

kamilzubair
Beginner
469 Views

I try to convert face_recognition_demo from python to c++. I managed to get the face detection and landmark detection running. But when I try to load face reidentification model it failed, this my code:
 

class FaceReidentification
{
public:
	void Init(InferenceEngine::Core& core, const std::string& File);
	void Process(const cv::Mat& img, const std::vector<cv::Rect>& results);
	auto& InputInfo() const { return m_InputInfo; }
	auto& OutputInfo() const { return m_OutputInfo; }
	auto& Network() const { return m_Network; }
private:
	
	InferenceEngine::CNNNetwork			m_Network;
	InferenceEngine::InputsDataMap		m_InputInfo;
	InferenceEngine::OutputsDataMap		m_OutputInfo;
	InferenceEngine::ExecutableNetwork	m_ExecutableNetwork;
	InferenceEngine::InferRequest		m_InferRequest;

	std::string							m_InputName;
	std::string							m_OutputName;
};
void FaceReidentification::Init(InferenceEngine::Core& core, const std::string& File)
{	
	m_Network = core.ReadNetwork(File);
	m_InputInfo = ie::InputsDataMap(m_Network.getInputsInfo());
	m_InputName = m_InputInfo.begin()->first;
	m_OutputInfo = ie::OutputsDataMap(m_Network.getOutputsInfo());
	m_OutputName = m_OutputInfo.begin()->first;
		
	m_ExecutableNetwork = core.LoadNetwork(m_Network, "CPU"); // throw exception here
	m_InferRequest = m_ExecutableNetwork.CreateInferRequest();
}

I got 'Exception thrown at 0x00007FF87170354E (inference_engine_legacyd.dll) in vision.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000001E8C4A3FF8).'

This exception only happend in Debug mode, in Release mode nothing is thrown. Any idea what should I do ?

0 Kudos
1 Solution
kamilzubair
Beginner
469 Views

I managed to solve the issue. I tried to create my program step by step and I found out that the exception only happen when I allocate a large array in the stack, my guess is that it makes the stack overflows when loading the network. When I change my array to be allocated in the heap, everything works fine.

View solution in original post

0 Kudos
1 Reply
kamilzubair
Beginner
470 Views

I managed to solve the issue. I tried to create my program step by step and I found out that the exception only happen when I allocate a large array in the stack, my guess is that it makes the stack overflows when loading the network. When I change my array to be allocated in the heap, everything works fine.

0 Kudos
Reply