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

CPU profile 2 process throwing CUDA out of memory for one image with multiple items when propagate button is clicked #27

Open
zdhernandez opened this issue Dec 11, 2021 · 7 comments

Comments

@zdhernandez
Copy link

@hkchengrex
To replicate:

  • load only one image of width(3024 by 4032) in folder./example/test_folder/
  • run command: python interactive_gui.py --mem_profile 2 --images ./example/test_folder/ --resolution -1 --num_objects 4
  • click on one object to create overlay of the first object (red)
  • select num keypad 2 and click a different object (to produce overlay of different color)
  • select num keypag 3 and click a different object (to produce overlay of different color)
  • select num keypag 3 and click a different object (to produce overlay of different color)
  • click "propagate"
    Throws error. See picture.
    Screenshot from 2021-12-11 12-03-39

Even though I am doing one image if I click "Save" it does what is supposed to to (save overlay and mask). But clicking "Propagate" should not throw and error with cuda when --mem_profile was set to 2, right ? should not have used GPU.

@hkchengrex
Copy link
Owner

I did not write the boundary condition for a single image, so it might be doing some extra work. It is also not the intended usage of the GUI.
If you want single image segmentation you can just use the original f-BRS GUI: https://github.com/saic-vul/fbrs_interactive_segmentation

@zdhernandez
Copy link
Author

@hkchengrex can you add something to protect the boundary condition when it's a single image so that the GUI won't crash, please? Also, it's trying to pull GPU resources but the memory profile given was of type 2. I was not expecting a CUDA out-of-memory error to appear.

@hkchengrex
Copy link
Owner

It still uses the GPU even with mem_profile=2. We just buffer less on the GPU.
I cannot think of a general use case where it will be useful to do propagation on a single image. If you can create a pull request for that I can probably merge it.

@zdhernandez
Copy link
Author

@hkchengrex Is just protection so that it won't crash. And yes, I think it's doing extra work. It'll take me forever to set the project in debug mode and add the changes. I would prefer it if you add the protection. That's probably the last thing that's making the GUI crash right now. I've tried other combinations and it's doing pretty well.

@hkchengrex
Copy link
Owner

If you don't need to propagate then just don't click that button

@zdhernandez
Copy link
Author

@hkchengrex Nah this is more from a software test context. The GUI should never crash.

@hkchengrex
Copy link
Owner

I see. That's a memory error (it is expected to use the GPU) and if we were to solve it we would need to guard against all CUDA OOM errors. I can see how that's useful in a production setting but it is of very low priority in this for-research codebase.
I agree that adding a guard is beneficial so pull requests are welcome.

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

No branches or pull requests

2 participants