Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [Windows] Error: "Expression: cannot seek vector iterator after end" when running mmdeploy::Detector::Apply in debug version of mmdeploy library. #1537

Closed
3 tasks done
antoszy opened this issue Dec 14, 2022 · 1 comment · Fixed by #1555
Assignees

Comments

@antoszy
Copy link
Contributor

antoszy commented Dec 14, 2022

Checklist

  • I have searched related issues but cannot get the expected help.
  • 2. I have read the FAQ documentation but cannot get the expected help.
  • 3. The bug has not been fixed in the latest version.

Describe the bug

When running mmdeploy::Detector::Apply function I get the following error:
image

Reproduction

Build debug version of the mmdeploy libraries with:

cmake .. -G "Visual Studio 16 2019" -A x64 -T v142 `
   -DMMDEPLOY_BUILD_SDK=ON `
   -DMMDEPLOY_BUILD_EXAMPLES=ON `
   -DMMDEPLOY_BUILD_SDK_PYTHON_API=ON `
   -DMMDEPLOY_BUILD_SDK_CXX_API=ON `
   -DMMDEPLOY_TARGET_DEVICES="cuda" `
   -DMMDEPLOY_TARGET_BACKENDS="trt" `
   -Dpplcv_DIR="$env:PPLCV_DIR/build_d/install/lib/cmake/ppl" `
   -DTENSORRT_DIR="$env:TENSORRT_DIR" `
   -DCUDNN_DIR="$env:CUDNN_DIR" `
   -Wno-dev `
   -DOpenCV_DIR="$env:OPENCV_DEBUG_DIR\..\.."
cmake --build . --config Debug -- /m
cmake --install . --config Debug

Crate TensorRT version of the model by running the following command:

python mmdeploy\tools\deploy.py \
	.\mmdeploy\configs\mmdet\instance-seg\instance-seg_tensorrt_static-800x1344.py  \
	.\mmdetection\configs\mask_rcnn\mask_rcnn_r50_fpn_1x_coco.py  \
	.\mmmodels\mask_rcnn_r50_fpn_2x_coco_bbox_mAP-0.392__segm_mAP-0.354_20200505_003907-3e542a40.pth  \
	.\mmdetection\demo\demo.jpg  \
	--work-dir .\mmdeploy_model\mask-rcnn  \
	--device cuda  \
	--dump-info \

Create a simple project in Visual Studio 2019 with the debug mmdeply library with the following code:

mmdeploy::Model _model("model_path");
mmdeploy::Detector = _detector(_model, mmdeploy::Device{ "cuda", 0 });
auto dets = _detector.Apply(cv_mat_img);

Compile, link with debug mmdeploy libraries and run the application.

Environment

- Windows
- IDE: Visual studio 2019 with v142 build tools
- Nvidia graphics card with CUDA
- MMDepoly version: v0.11.0

Error traceback

The error comes from this line:

std::vector<float>(mFeatmapStrides.begin(), mFeatmapStrides.begin() + nbInputs - 1);

I've identified the problem and I will create a PR to fix it.

@mbed92
Copy link

mbed92 commented Dec 14, 2022

The same for the newest Visual Studio 2022 (v143)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants