Python Forum
cv2.resize(...) shutting down processes?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cv2.resize(...) shutting down processes?
#1
I have multiple processes running, and in each, I am trying to resize and image using cv2.resize()

However, when I try, it just seems like the processes end there and then. There are no errors - not a single bit of output, it just ends.

Say I have this:
#do some image processing - image is now stored in 'img':
resized = cv2.resize(img, (10,10))
print(resize)
The output will be some resized numpy array which is correct.
However, if I now do this:
#create some processes - each process runs the piece of code below:
#do some image processing - image is now stored in 'img':
resized = cv2.resize(img, (10,10))
print(resize)
There is NO output. It just ends the process at the resize line.

I have tried debugging it with pdb, and I get no info on it - again it just ends.
I also added this at the beginning of the script:
import logging
mpl = multiprocessing.log_to_stderr()
mpl.setLevel(logging.DEBUG)
And then ran it with pdb - this is what I got:
Output:
(Pdb) b 439 Breakpoint 1 at /Users/everyone/Desktop/SubreddimagesV2/get_images_no_gif.py:439 (Pdb) c END Value missing from arguments! [LOG]: Creating gif [INFO/Process-1] child process calling self.run() [INFO/Process-2] child process calling self.run() > /Users/everyone/Desktop/SubreddimagesV2/get_images_no_gif.py(439)create_image_gif() -> resized = cv2.resize(new_img, (new_img.shape[1]//2, new_img.shape[0]//2, new_img.shape[2])) (Pdb) [INFO/Process-1] process shutting down [DEBUG/Process-1] running all "atexit" finalizers with priority >= 0 [DEBUG/Process-1] running the remaining "atexit" finalizers Process Process-1: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "/Users/everyone/Desktop/SubreddimagesV2/get_images_no_gif.py", line 439, in create_image_gif resized = cv2.resize(new_img, (new_img.shape[1]//2, new_img.shape[0]//2, new_img.shape[2])) File "/Users/everyone/Desktop/SubreddimagesV2/get_images_no_gif.py", line 439, in create_image_gif resized = cv2.resize(new_img, (new_img.shape[1]//2, new_img.shape[0]//2, new_img.shape[2])) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/bdb.py", line 51, in trace_dispatch return self.dispatch_line(frame) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/bdb.py", line 70, in dispatch_line if self.quitting: raise BdbQuit bdb.BdbQuit [INFO/Process-1] process exiting with exitcode 1
Now, 'exitcode 1' means there was some kind of error - i'm not sure if this is what is causing the problem, or if it is just because it was quit through this line:
if self.quitting: raise BdbQuit
Either way, what is going on here? Why is cv2.resize not working?
Reply
#2
Anyone got an idea?

I already have a workaround in my code but I'm still curious as to know what's going on.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter Pillow Resize Image Looks Choppy While Resizing AaronCatolico1 2 1,326 Jan-03-2023, 05:41 PM
Last Post: AaronCatolico1
  processes shall be parallel flash77 4 1,066 Sep-20-2022, 11:46 AM
Last Post: DeaD_EyE
  Sharing imported modules with Sub Processes? Stubblemonster 2 1,462 May-02-2022, 06:42 AM
Last Post: Stubblemonster
  Killing processes via python Lavina 2 2,560 Aug-04-2021, 06:20 AM
Last Post: warnerarc
  How to share a numpy array between 2 processes on Windows? qstdy 0 2,136 Jan-29-2021, 04:24 AM
Last Post: qstdy
  sharing variables between two processes Kiyoshi767 1 1,848 Nov-07-2020, 04:00 AM
Last Post: ndc85430
  2 or more processes on the write end of the same pipe Skaperen 4 3,790 Sep-27-2020, 06:41 PM
Last Post: Skaperen
  Errors using --processes parameter sonhospa 3 2,348 Jul-01-2020, 02:24 PM
Last Post: sonhospa
  python-resize-image unicode decode error Pedroski55 3 3,400 Apr-21-2020, 10:56 AM
Last Post: Pedroski55
  waiting for many processes in parallel Skaperen 2 1,857 Sep-02-2019, 02:20 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020