i have issue matplotlib , multiprocessing. launch first process, display image , select area, , close figure. launch process, call graph function regularly updated. point, eveything works fine. when try launch process same graph function, freeze whole computer, background processes stil work... have 1 of these errors (it's not same):
error 1 :
xio: fatal io error 25 (inappropriate ioctl device) on x server ":0.0" after 4438 requests (4438 known processed) 30 events remaining. xio: fatal io error 11 (resource temporarily unavailable) on x server ":0.0" after 4443 requests (4443 known processed) 31 events remaining. [xcb] unknown sequence number while processing queue [xcb] multi-threaded client , xinitthreads has not been called [xcb] aborting, sorry that. python: ../../src/xcb_io.c:274: poll_for_event: assertion `!xcb_xlib_threads_sequence_lost' failed.
error 2 :
x error of failed request: badidchoice (invalid resource id chosen connection) major opcode of failed request: 53 (x_createpixmap) resource id in failed request: 0x5600299 serial number of failed request: 4793 current serial number in output stream: 4795 xio: fatal io error 25 (inappropriate ioctl device) on x server ":0.0" after 4788 requests (4788 known processed) 31 events remaining. xio: fatal io error 25 (inappropriate ioctl device) on x server ":0.0" after 4793 requests (4793 known processed) 32 events remaining.
the weird part can totaly launch several process calling graph function without issue, it's coupling first plot make unstable.
when trying debug, found out simple fig=plt.figure() enough crash : in fact, call plt ...
i read here , there can force matplotlib use agg backend , helps multiprocess, widgets doesn't work avoid this.
i don't understand why using matplotlib in differents processes cause problems, if explain reasons and/or me workaround, nice.
since cannot comment, small tip answer. if on linux machine or have access via ssh, can unfreeze computer switching terminal , kill processes of script. enable input on x again. if not have other python processes, easiest way is
killall python # python3 if use version 3 or if want careful
ps | grep python kill # add pid numbers of processes here
Comments
Post a Comment