complier SDK used in VS2015 error?

2 views (last 30 days)
cui,xingxing
cui,xingxing on 21 Jun 2018
Commented: cforem5 on 6 Dec 2018
When I compile the m file into the dll library, the following error occurs in VS2015 call, how to solve?
#include<iostream>
#include"opencv2/opencv.hpp"
#include "opencv2/dnn/all_layers.hpp"
#include"opencv2/dnn.hpp"
#include "LSTMPredict.h"
#include "CmFile\CmFile.h"
using namespace cv::dnn;
using namespace std;
using namespace cv;
#pragma comment (lib, "LSTMPredict.lib")
int main()
{
String modelTxt = "D:\\VS_2015_work\\ActivityRecognition\\ActivityRecognition\\model\\deploy_inception-v3.prototxt";
String modelBin = "D:\\VS_2015_work\\ActivityRecognition\\ActivityRecognition\\model\\inception-v3.caffemodel";
String imageFiles = "D:\\temp\\train_data\\单反\\2";
Net net = dnn::readNetFromCaffe(modelTxt, modelBin);
if (net.empty())
cout << "net is empty!" << endl;
vector<string> imagepaths;
int nums = CmFile::GetImageFromFolderAndSub(imageFiles, imagepaths, ".jpg");
vector<Mat> images(nums,Mat::zeros(299,299,CV_32F));
for (size_t i = 0; i < nums; i++)
{
images[i] = imread(imagepaths[i]);
}
Mat blobs = blobFromImages(images, 1.0/255, Size(299, 299));
net.setInput(blobs, "data");
double time1 = cvGetTickCount();
Mat features = net.forward("pool_8x8_s1_drop").reshape(1, nums).t();//2048*nums
printf("take times(ms):%f\n", (cvGetTickCount() - time1) / getTickFrequency() * 1000);
Mat blob = blobFromImage(images[0], 1.0 / 255, Size(299, 299));
net.setInput(blob, "data");
double time2 = cvGetTickCount();
Mat feature = net.forward("pool_8x8_s1_drop").reshape(1, 1);
printf("take times(ms):%f\n", (cvGetTickCount() - time2) / getTickFrequency() * 1000);
// Call application and library initialization. Perform this
// initialization before calling any API functions or
// Compiler SDK-generated libraries.
if (!mclInitializeApplication(nullptr, 0))
{
std::cerr << "Could not initialize the application properly"
<< std::endl;
return -1;
}
if (!LSTMPredictInitialize())
{
std::cerr << "Could not initialize LSTMPredictInitialize"
<< std::endl;
return -1;
}
int nargout = 2;
mwArray predictedLabel;
mwArray score;
mwArray sequence_feature(2048, nums, mxDOUBLE_CLASS);
sequence_feature.SetData(features.data, 2048 * nums);
LSTMPredict(nargout, predictedLabel, score, sequence_feature);
char label_chr[50] = { };
double score_d[] = { 0 };
//predictedLabel.GetData(label_chr);
score.GetData(score_d,20);
//cout << "label,score: "<<predictedLabel << "," << score << endl;
LSTMPredictTerminate();
return 0;
}
------------------------------------------------------------------------
Unhandled C++ exception detected at Wed Jun 20 16:39:55 2018
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Default Encoding : GBK
Deployed : true
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA GeForce GTX 1050 Ti Version 23.21.13.9135 (2018-3-23)
Host Name : P-cuixingxing
MATLAB Architecture : win64
MATLAB Entitlement ID: Unknown
MATLAB Root : C:\Program Files\MATLAB\R2017b
MATLAB Version : 9.3.0.713579 (R2017b)
OpenGL : hardware
Operating System : Microsoft Windows 10 企业版
Processor ID : x86 Family 6 Model 94 Stepping 3, GenuineIntel
Virtual Machine : Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : Version 10.0 (Build 14393)
Fault Count: 1
Abnormal termination:
Unhandled C++ exception
Register State (from fault):
RAX = ffffffffffffffff RBX = 0000000000000018
RCX = 0000000000000270 RDX = 00000000000003ff
RSP = 00000077da7df2e0 RBP = 00000077da7df420
RSI = 00007ff608948af0 RDI = 0000000000000000
R8 = 0000000000000000 R9 = 408f400000000000
R10 = 0000000000000000 R11 = 42547b8787230000
R12 = 0000000000000000 R13 = 000000000000c000
R14 = 00000077da7df460 R15 = 0000000000000900
RIP = 00007ffc3e287788 EFL = 00000202
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x00007ffc3e287788 C:\Windows\System32\KERNELBASE.dll+00096136 RaiseException+00000104
[ 1] 0x00007ffc12734462 C:\Windows\SYSTEM32\VCRUNTIME140.dll+00017506 CxxThrowException+00000194
[ 2] 0x00007ff60894344e D:\VS_2015_work\test1\x64\Release\test1.exe+00013390 mwException::raise_error+00000174
[ 3] 0x00007ff60894407d D:\VS_2015_work\test1\x64\Release\test1.exe+00016509 main+00002813
[ 4] 0x00007ff608944cd5 D:\VS_2015_work\test1\x64\Release\test1.exe+00019669 __scrt_common_main_seh+00000285
[ 5] 0x00007ffc40ea8364 C:\Windows\System32\KERNEL32.DLL+00033636 BaseThreadInitThunk+00000020
[ 6] 0x00007ffc41175e91 C:\Windows\SYSTEM32\ntdll.dll+00417425 RtlUserThreadStart+00000033
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.
my "LSTMPredict.m" file is :
function [predictedLabel,score] = LSTMPredict(sequence_feature)
% 对单个动作序列进行分类,sequence_feature为2048*T列矩阵
persistent net
if isempty(net)
net = load('human_action_inception_net97.mat');
net = net.net;
end
if ~isnumeric(sequence_feature)&&(size(sequence_feature,1)~=2048)
return;
end
[predictedLabel,score] = classify(net,sequence_feature);
predictedLabel = char(predictedLabel);
  1 Comment
cforem5
cforem5 on 6 Dec 2018
I'm getting a similar message in my crash file. Matlab is closing in the middle of a simulation with no error message or warning.
Recently updated computer to win10 and I'm using Matlab 2018b.
Wondering if it's a Windows 10 related issue?
Message is below:
--------------------------------------------------------------------------------
Unhandled C++ exception detected at Thu Dec 06 12:32:01 2018 -0600
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : windows-1252
Deployed : false
Graphics Driver : NVIDIA Corporation Quadro M1000M/PCIe/SSE2 Version 4.5.0 NVIDIA 386.01
Graphics card 1 : DameWare Development 64 ( 0x0 ) DameWare Development Mirror Driver 64-bit Version 0.0.0.0 (1601-1-1)
Graphics card 2 : NVIDIA ( 0x10de ) NVIDIA Quadro M1000M Version 22.21.13.8601 (2017-12-2)
Graphics card 3 : Intel Corporation ( 0x8086 ) Intel(R) HD Graphics 530 Version 22.20.16.4836 (2017-10-17)
Java Version : Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : win64
MATLAB Entitlement ID : 808735
MATLAB Root : C:\Program Files\MATLAB\R2018b
MATLAB Version : 9.5.0.944444 (R2018b)
OpenGL : hardware
Operating System : Microsoft Windows 10 Enterprise
Process ID : 9728
Processor ID : x86 Family 6 Model 94 Stepping 3, GenuineIntel
Session Key : 25624297-f578-44c3-a7df-65345fd127fa
Window System : Version 10.0 (Build 16299)
Fault Count: 1
Abnormal termination
Register State (from fault):
RAX = 00000000fde6cdbc RBX = 00000000066126b0
RCX = 00000000ca9a0000 RDX = 0000000000150db0
RSP = 00000000ca9af7f0 RBP = 00000000ca9af930
RSI = 00000000fe04a3a0 RDI = 0000000010e1ada0
R8 = 0000000000000001 R9 = 0000000000000000
R10 = 0000000000000003 R11 = 0000000000000030
R12 = 0000000000000000 R13 = 0000000000000000
R14 = 00000000ca9af978 R15 = 0000000000000000
RIP = 00007ffbc63250d8 EFL = 00000202
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x00007ffbc63250d8 C:\Windows\System32\KERNELBASE.dll+00282840 RaiseException+00000104
[ 1] 0x00007ffbb5cd44f2 C:\Program Files\MATLAB\R2018b\bin\win64\VCRUNTIME140.dll+00017650 CxxThrowException+00000194
[ 2] 0x00000000fdd7b70f bin\win64\libmwms.dll+00440079 foundation::msg_svc::eventmgr::serialize+00027135
[ 3] 0x00000000fde5df7a bin\win64\libmwms.dll+01367930 foundation::msg_svc::eventmgr::detail::SystemCbPack::toString+00183962
[ 4] 0x00000000fde6c59b bin\win64\libmwms.dll+01426843 foundation::msg_svc::eventmgr::detail::SystemCbPack::toString+00242875
[ 5] 0x00000000fde8d21d bin\win64\libmwms.dll+01561117 foundation::msg_svc::eventmgr::detail::SystemCbPack::toString+00377149
[ 6] 0x00000000fde8eb46 bin\win64\libmwms.dll+01567558 foundation::msg_svc::eventmgr::detail::SystemCbPack::toString+00383590
[ 7] 0x00007ffbac18c8b3 C:\Program Files\MATLAB\R2018b\bin\win64\mwboost_thread-vc140-mt-1_65_1.dll+00051379 mwboost::detail::win32::handle_manager::swap+00000083
[ 8] 0x00007ffbc660dab5 C:\Windows\System32\ucrtbase.dll+00121525 iswascii+00000165
[ 9] 0x00007ffbc9231fe4 C:\Windows\System32\KERNEL32.DLL+00073700 BaseThreadInitThunk+00000020
[ 10] 0x00007ffbc9bfcb81 C:\Windows\SYSTEM32\ntdll.dll+00445313 RtlUserThreadStart+00000033

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Compiler SDK in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!