yuefanhao / SuperPoint-SuperGlue-TensorRT

SuperPoint and SuperGlue with TensorRT. Deploy with C++.
Apache License 2.0
250 stars 45 forks source link

'std::bad_alloc' Error on Changing Image Dimensions in 'config.yaml' #37

Open parsahemmasi opened 3 months ago

parsahemmasi commented 3 months ago

Description When I attempt to change the image_width and image_height values in the config.yaml file from the default 320x240 to any other dimensions, the engine file builds successfully. However, during inference, the following error occurs:

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted(core dumped)

Steps to Reproduce

  1. Clone the repository.
  2. Modify the config.yaml file to change image_width and image_height values to something other than 320x240 (e.g., 1280x960).
  3. Run the superpointglue_image with two 1280x960 images as input arguments.

Expected Behavior The inference should run successfully with the updated image dimensions.

Actual Behavior The process terminates with a std::bad_alloc error, indicating a memory allocation issue.

Environment

Additional Context

vickersmt commented 3 months ago

I think you should modify the size of the dynamic input in superpoint.cpp and superglue.cpp,search"profile->setDimensions"

parsahemmasi commented 3 months ago

I think you should modify the size of the dynamic input in superpoint.cpp and superglue.cpp,search"profile->setDimensions"

I have tried but this time I got an error about building engine. Would you please explain more? And what is your recommended modification for inferencing two 1280x960 images?