Fix segmentation fault when using gpu to resize, using opencv cudawar… #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I could not get videocaptioning to work using the GPU and would always get a segmentation fault specifically on
local cropsc = cv.resize{src=crop, dsize={256,256}}
.Doing some research on google I found someone else had a segementation fault using opencv because they were not using cudawarping and cuda to resize. I then noticed that when I luarocks torch-opencv it was warning me that it was not building with cuda support. I then found out that I did not install opencv with cuda support.
So after installing opencv with cuda support then installing torch-opencv with cuda support and lastly using cuda to resize, I was able to then use videocaptioning to work using the GPU. Tested working with OpenCV 3.1 and the latest torch-opencv.
I'm not sure if anyone is experiencing this issue and wondering if they were not how they got videocaptioning to work using the GPU.
I also tested the fix should continue to allow videocaptioning to work with the CPU instead of the GPU.