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

DeepLabCut MacOS Pyenv Build Crashes on Label_Frames #1742

Closed
1 task done
JacobBumgarner opened this issue Mar 24, 2022 · 4 comments
Closed
1 task done

DeepLabCut MacOS Pyenv Build Crashes on Label_Frames #1742

JacobBumgarner opened this issue Mar 24, 2022 · 4 comments

Comments

@JacobBumgarner
Copy link
Contributor

JacobBumgarner commented Mar 24, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Bug description

I'm running DeepLabCut on my Mac (11.6.2), but every time I go to label frames, the program crashes. The long error report that's being spit out can be seen below; I haven't been able to figure out what's going on.

I've been trying to run the package on a Pyenv build (python version 3.8.12) with the latest versions of DLC. Because Pyenv doesn't provide a shim for wxPython (pythonw), I installed the 3.8.12 as a framework build. This allows me to run the GUI version of DLC, but a crash occurs when I try to label frames with the GUI. This happens if I'm running DLC from the GUI or if I just run deeplabcut.label_frames(config_path). The label_frame GUI opens, but the crash specifically occurs when a folder with frames to be labeled is selected and loaded.

I thought this might be an issue specific to Pyenv, so I installed Anaconda, and after running conda install python.app in the DLC environment, I can label frames successfully, indicating that this problem is specific to Pyenv.

Are there any ideas of how to get DLC working with Pyenv? If not - I can just continue using conda. Thanks in advance!

Operating System

macOS Big Sur 11.6.2

DeepLabCut version

deeplabcut==2.2.0.6

DeepLabCut mode

single animal

Device type

CPU - 2.6 GHz 6-Core Intel Core i7

Steps To Reproduce

  1. Install Pyenv with brew and set up all of the correct shim/shell modifications

  2. Install python 3.8.12 using env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.8.12 and update pip pip install -U pip

  3. Install DeepLabCut pip install deeplabcut 'deeplabcut[gui]'

  4. Open DLC from the GUI or try to just label frames. python -m deeplabcut or after opening python and loading the config path, deeplabcut.label_frames(config_path)

  5. Cause the crash by loading a folder with the frames to label from the DLC path.

Relevant log output

(DLC_T) jacobbumgarner@Jacobs-MacBook-Pro-3 ~ % python -m deeplabcut
Starting GUI...
*** Received signal 11 ***
*** BEGIN MANGLED STACK TRACE ***
0   libtensorflow_framework.2.dylib     0x000000010224f3f7 _ZN10tensorflow7testingL17StacktraceHandlerEiP9__siginfoPv + 183
1   libsystem_platform.dylib            0x00007fff208c9d7d _sigtramp + 29
2   ???                                 0x0000000000000001 0x0 + 1
3   CoreGraphics                        0x00007fff254b2d9f CGFunctionEvaluate + 252
4   CoreGraphics                        0x00007fff254b2c05 function_evaluate + 365
5   CoreGraphics                        0x00007fff254b23c5 ripc_AcquireFunction + 1018
6   CoreGraphics                        0x00007fff254b161f ripc_DrawShading + 5621
7   CoreGraphics                        0x00007fff2580c66e _ZN2CG19DisplayListExecutor11drawShadingEPKNS_23DisplayListEntryShadingE + 636
8   CoreGraphics                        0x00007fff258bcc8b _ZN2CG11DisplayList14executeEntriesENSt3__111__wrap_iterIPNS1_10unique_ptrIKNS_16DisplayListEntryENS1_14default_deleteIS5_EEEEEESA_P17CGContextDelegateP16CGRenderingStateP8CGGStackPK6CGRectPK14__CFDictionaryb + 263
9   CoreGraphics                        0x00007fff2553feed _ZN2CG11DisplayList7executeEP17CGContextDelegateP16CGRenderingStateP8CGGStackPK6CGRectPK14__CFDictionary + 363
10  CoreGraphics                        0x00007fff2553fb5f CGDisplayListDrawInContextDelegate + 529
11  QuartzCore                          0x00007fff2710e3d0 CABackingStoreUpdate_ + 570
12  QuartzCore                          0x00007fff2717584d ___ZN2CA5Layer8display_Ev_block_invoke + 53
13  QuartzCore                          0x00007fff2710d787 -[CALayer _display] + 2247
14  AppKit                              0x00007fff232f21f5 -[_NSBackingLayer display] + 475
15  AppKit                              0x00007fff2325d2e2 -[_NSViewBackingLayer display] + 555
16  QuartzCore                          0x00007fff2710c6f3 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 863
17  QuartzCore                          0x00007fff27257bee _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 666
18  QuartzCore                          0x00007fff270edb6f _ZN2CA11Transaction6commitEv + 713
19  AppKit                              0x00007fff2330746c __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 285
20  AppKit                              0x00007fff23a5d112 ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
21  CoreFoundation                      0x00007fff2097b731 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
22  CoreFoundation                      0x00007fff2097b5c5 __CFRunLoopDoObservers + 543
23  CoreFoundation                      0x00007fff2097aa58 __CFRunLoopRun + 841
24  CoreFoundation                      0x00007fff2097a04c CFRunLoopRunSpecific + 563
25  HIToolbox                           0x00007fff28bc2a83 RunCurrentEventLoopInMode + 292
26  HIToolbox                           0x00007fff28bc26b6 ReceiveNextEventCommon + 284
27  HIToolbox                           0x00007fff28bc2583 _BlockUntilNextEventMatchingListInModeWithFilter + 70
28  AppKit                              0x00007fff23182d72 _DPSNextEvent + 864
29  AppKit                              0x00007fff23181545 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
30  libwx_osx_cocoau_core-3.0.0.4.0.dyl 0x00000001508cddac _ZN14wxGUIEventLoop8OSXDoRunEv + 268
31  libwx_baseu-3.0.0.4.0.dylib         0x0000000150ee5091 _ZN13wxCFEventLoop5DoRunEv + 49
32  libwx_baseu-3.0.0.4.0.dylib         0x0000000150e351a2 _ZN15wxEventLoopBase3RunEv + 162
33  libwx_baseu-3.0.0.4.0.dylib         0x0000000150dfe093 _ZN16wxAppConsoleBase8MainLoopEv + 99
34  _core.cpython-38-darwin.so          0x000000014fdd59b1 _ZN7wxPyApp8MainLoopEv + 81
35  _core.cpython-38-darwin.so          0x000000014fdd83f3 _ZL21meth_wxPyApp_MainLoopP7_objectS0_ + 147
36  Python                              0x0000000100ff96f3 cfunction_call_varargs + 323
37  Python                              0x0000000100ff9076 _PyObject_MakeTpCall + 374
38  Python                              0x00000001010da9ac call_function + 652
39  Python                              0x00000001010d6f3c _PyEval_EvalFrameDefault + 30364
40  Python                              0x0000000100ff9a2d function_code_fastcall + 237
41  Python                              0x00000001010da882 call_function + 354
42  Python                              0x00000001010d6f1f _PyEval_EvalFrameDefault + 30335
43  Python                              0x00000001010db8f4 _PyEval_EvalCodeWithName + 3268
44  Python                              0x0000000100ff9bad _PyFunction_Vectorcall + 253
45  Python                              0x00000001010da882 call_function + 354
46  Python                              0x00000001010d70b4 _PyEval_EvalFrameDefault + 30740
47  Python                              0x00000001010db8f4 _PyEval_EvalCodeWithName + 3268
48  Python                              0x0000000100ff9bad _PyFunction_Vectorcall + 253
49  Python                              0x00000001010da882 call_function + 354
50  Python                              0x00000001010d6ff0 _PyEval_EvalFrameDefault + 30544
51  Python                              0x0000000100ff9a2d function_code_fastcall + 237
52  Python                              0x0000000100ffc4fd method_vectorcall + 461
53  Python                              0x0000000100ff93c4 PyVectorcall_Call + 100
54  _core.cpython-38-darwin.so          0x000000014fc29359 _ZN12wxPyCallback12EventThunkerER7wxEvent + 281
55  libwx_baseu-3.0.0.4.0.dylib         0x0000000150f0c1f6 _ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent + 182
56  libwx_baseu-3.0.0.4.0.dylib         0x0000000150f0bf7b _ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent + 59
57  libwx_baseu-3.0.0.4.0.dylib         0x0000000150f0be24 _ZN12wxEvtHandler12ProcessEventER7wxEvent + 100
58  _core.cpython-38-darwin.so          0x000000014fb7d4db _ZN11sipwxButton12ProcessEventER7wxEvent + 107
59  libwx_baseu-3.0.0.4.0.dylib         0x0000000150f0c29c _ZN12wxEvtHandler18SafelyProcessEventER7wxEvent + 12
60  libwx_osx_cocoau_core-3.0.0.4.0.dyl 0x000000015084576e _ZN8wxButton16OSXHandleClickedEd + 62
61  libwx_osx_cocoau_core-3.0.0.4.0.dyl 0x00000001508eb84a _ZN17wxWidgetCocoaImpl13controlActionEP6NSViewPvS2_ + 42
62  AppKit                              0x00007fff233a3ebb -[NSApplication(NSResponder) sendAction:to:from:] + 288
63  AppKit                              0x00007fff233a3d5f -[NSControl sendAction:to:] + 86
64  AppKit                              0x00007fff233a3c91 __26-[NSCell _sendActionFrom:]_block_invoke + 131
65  AppKit                              0x00007fff233a3b98 -[NSCell _sendActionFrom:] + 171
66  AppKit                              0x00007fff233a3ade -[NSButtonCell _sendActionFrom:] + 96
67  AppKit                              0x00007fff233a0bc7 NSControlTrackMouse + 1820
68  AppKit                              0x00007fff233a0483 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 130
69  AppKit                              0x00007fff233a034a -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 697
70  AppKit                              0x00007fff2339f672 -[NSControl mouseDown:] + 722
71  libwx_osx_cocoau_core-3.0.0.4.0.dyl 0x00000001508ea56e _ZN17wxWidgetCocoaImpl10mouseEventEP7NSEventP6NSViewPv + 254
72  AppKit                              0x00007fff2339da5e -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961
73  AppKit                              0x00007fff2330d248 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2594
74  AppKit                              0x00007fff2330c606 -[NSWindow(NSEventRouting) sendEvent:] + 347
75  libwx_osx_cocoau_core-3.0.0.4.0.dyl 0x00000001508d78cb -[wxNSWindow sendEvent:] + 123
76  AppKit                              0x00007fff2330aa14 -[NSApplication(NSEvent) sendEvent:] + 352
77  libwx_osx_cocoau_core-3.0.0.4.0.dyl 0x0000000150821b42 -[wxNSApplication sendEvent:] + 98
78  AppKit                              0x00007fff235e37e1 -[NSApplication _handleEvent:] + 65
79  AppKit                              0x00007fff2317388e -[NSApplication run] + 623
80  libwx_osx_cocoau_core-3.0.0.4.0.dyl 0x00000001508cdd6f _ZN14wxGUIEventLoop8OSXDoRunEv + 207
81  libwx_baseu-3.0.0.4.0.dylib         0x0000000150ee5091 _ZN13wxCFEventLoop5DoRunEv + 49
82  libwx_baseu-3.0.0.4.0.dylib         0x0000000150e351a2 _ZN15wxEventLoopBase3RunEv + 162
83  libwx_baseu-3.0.0.4.0.dylib         0x0000000150dfe093 _ZN16wxAppConsoleBase8MainLoopEv + 99
84  _core.cpython-38-darwin.so          0x000000014fdd59b1 _ZN7wxPyApp8MainLoopEv + 81
85  _core.cpython-38-darwin.so          0x000000014fdd83f3 _ZL21meth_wxPyApp_MainLoopP7_objectS0_ + 147
86  Python                              0x0000000100ff96f3 cfunction_call_varargs + 323
87  Python                              0x0000000100ff9076 _PyObject_MakeTpCall + 374
88  Python                              0x00000001010da9ac call_function + 652
89  Python                              0x00000001010d6f3c _PyEval_EvalFrameDefault + 30364
90  Python                              0x0000000100ff9a2d function_code_fastcall + 237
91  Python                              0x00000001010da882 call_function + 354
92  Python                              0x00000001010d6f1f _PyEval_EvalFrameDefault + 30335
93  Python                              0x0000000100ff9a2d function_code_fastcall + 237
94  Python                              0x00000001010da882 call_function + 354
95  Python                              0x00000001010d6f3c _PyEval_EvalFrameDefault + 30364
96  Python                              0x00000001010db8f4 _PyEval_EvalCodeWithName + 3268
97  Python                              0x00000001010cf800 PyEval_EvalCode + 48
98  Python                              0x00000001010ccc2a builtin_exec + 618
99  Python                              0x00000001010391d1 cfunction_vectorcall_FASTCALL + 177
100 Python                              0x00000001010da882 call_function + 354
101 Python                              0x00000001010d6ff0 _PyEval_EvalFrameDefault + 30544
102 Python                              0x00000001010db8f4 _PyEval_EvalCodeWithName + 3268
103 Python                              0x0000000100ff9bad _PyFunction_Vectorcall + 253
104 Python                              0x00000001010da882 call_function + 354
105 Python                              0x00000001010d6ff0 _PyEval_EvalFrameDefault + 30544
106 Python                              0x00000001010db8f4 _PyEval_EvalCodeWithName + 3268
107 Python                              0x0000000100ff9bad _PyFunction_Vectorcall + 253
108 Python                              0x0000000100ff93c4 PyVectorcall_Call + 100
109 Python                              0x0000000101140440 pymain_run_module + 192
110 Python                              0x000000010113fb28 Py_RunMain + 1416
111 Python                              0x0000000101140313 pymain_main + 403
112 Python                              0x000000010114036b Py_BytesMain + 43
113 libdyld.dylib                       0x00007fff2089ff3d start + 1
*** END MANGLED STACK TRACE ***

*** Begin stack trace ***
	tensorflow::CurrentStackTrace()
	tensorflow::testing::StacktraceHandler(int, __siginfo*, void*)
	_sigtramp
	
	CGFunctionEvaluate
	function_evaluate
	ripc_AcquireFunction
	ripc_DrawShading
	CG::DisplayListExecutor::drawShading(CG::DisplayListEntryShading const*)
	CG::DisplayList::executeEntries(std::__1::__wrap_iter<std::__1::unique_ptr<CG::DisplayListEntry const, std::__1::default_delete<CG::DisplayListEntry const> >*>, std::__1::__wrap_iter<std::__1::unique_ptr<CG::DisplayListEntry const, std::__1::default_delete<CG::DisplayListEntry const> >*>, CGContextDelegate*, CGRenderingState*, CGGStack*, CGRect const*, __CFDictionary const*, bool)
	CG::DisplayList::execute(CGContextDelegate*, CGRenderingState*, CGGStack*, CGRect const*, __CFDictionary const*)
	CGDisplayListDrawInContextDelegate
	CABackingStoreUpdate_
	invocation function for block in CA::Layer::display_()
	-[CALayer _display]
	-[_NSBackingLayer display]
	-[_NSViewBackingLayer display]
	CA::Layer::display_if_needed(CA::Transaction*)
	CA::Context::commit_transaction(CA::Transaction*, double, double*)
	CA::Transaction::commit()
	__62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke
	___NSRunLoopObserverCreateWithHandler_block_invoke
	__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
	__CFRunLoopDoObservers
	__CFRunLoopRun
	CFRunLoopRunSpecific
	RunCurrentEventLoopInMode
	ReceiveNextEventCommon
	_BlockUntilNextEventMatchingListInModeWithFilter
	_DPSNextEvent
	-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
	wxGUIEventLoop::OSXDoRun()
	wxCFEventLoop::DoRun()
	wxEventLoopBase::Run()
	wxAppConsoleBase::MainLoop()
	wxPyApp::MainLoop()
	meth_wxPyApp_MainLoop(_object*, _object*)
	cfunction_call_varargs
	_PyObject_MakeTpCall
	call_function
	_PyEval_EvalFrameDefault
	function_code_fastcall
	call_function
	_PyEval_EvalFrameDefault
	_PyEval_EvalCodeWithName
	_PyFunction_Vectorcall
	call_function
	_PyEval_EvalFrameDefault
	_PyEval_EvalCodeWithName
	_PyFunction_Vectorcall
	call_function
	_PyEval_EvalFrameDefault
	function_code_fastcall
	method_vectorcall
	PyVectorcall_Call
	wxPyCallback::EventThunker(wxEvent&)
	wxEvtHandler::SearchDynamicEventTable(wxEvent&)
	wxEvtHandler::ProcessEventLocally(wxEvent&)
	wxEvtHandler::ProcessEvent(wxEvent&)
	sipwxButton::ProcessEvent(wxEvent&)
	wxEvtHandler::SafelyProcessEvent(wxEvent&)
	wxButton::OSXHandleClicked(double)
	wxWidgetCocoaImpl::controlAction(NSView*, void*, void*)
	-[NSApplication(NSResponder) sendAction:to:from:]
	-[NSControl sendAction:to:]
	__26-[NSCell _sendActionFrom:]_block_invoke
	-[NSCell _sendActionFrom:]
	-[NSButtonCell _sendActionFrom:]
	NSControlTrackMouse
	-[NSCell trackMouse:inRect:ofView:untilMouseUp:]
	-[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]
	-[NSControl mouseDown:]
	wxWidgetCocoaImpl::mouseEvent(NSEvent*, NSView*, void*)
	-[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:]
	-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:]
	-[NSWindow(NSEventRouting) sendEvent:]
	-[wxNSWindow sendEvent:]
	-[NSApplication(NSEvent) sendEvent:]
	-[wxNSApplication sendEvent:]
	-[NSApplication _handleEvent:]
	-[NSApplication run]
	wxGUIEventLoop::OSXDoRun()
	wxCFEventLoop::DoRun()
	wxEventLoopBase::Run()
	wxAppConsoleBase::MainLoop()
	wxPyApp::MainLoop()
	meth_wxPyApp_MainLoop(_object*, _object*)
	cfunction_call_varargs
	_PyObject_MakeTpCall
	call_function
	_PyEval_EvalFrameDefault
	function_code_fastcall
	call_function
	_PyEval_EvalFrameDefault
	function_code_fastcall
	call_function
	_PyEval_EvalFrameDefault
	_PyEval_EvalCodeWithName
	PyEval_EvalCode
	builtin_exec
	cfunction_vectorcall_FASTCALL
	call_function
	_PyEval_EvalFrameDefault
	_PyEval_EvalCodeWithName
	_PyFunction_Vectorcall
	call_function
	_PyEval_EvalFrameDefault
	_PyEval_EvalCodeWithName
	_PyFunction_Vectorcall
	PyVectorcall_Call
	pymain_run_module
	Py_RunMain
	pymain_main
	Py_BytesMain
	start
*** End stack trace ***
zsh: abort      python -m deeplabcut


### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/DeepLabCut/DeepLabCut/blob/master/CODE_OF_CONDUCT.md)
@MMathisLab
Copy link
Member

@JacobBumgarner can you run as pythonw -m deeplabcut ? that is what we support for macOS

@JacobBumgarner
Copy link
Contributor Author

Unfortunately Pyenv doesn’t create shims for pythonw. One of the devs suggested that it wasn’t needed. The reason I was imagining that it might be a DLC issue is because I can get the GUI running and working for everything but the label_frames.

I can create an issue over on the Pyenv page if you think this isn’t a DLC issue!

Thanks for your help!

@jeylau
Copy link
Member

jeylau commented May 16, 2022

@JacobBumgarner, any reason why you chose to install deeplabcut without conda or venv? I have no problem labeling frames on my mac (Monterey) using either one, so I suspect this has to do with your pyenv installation 😕

@JacobBumgarner
Copy link
Contributor Author

Frankly, I just tried using pyenv because it is my main environment manager. I originally used conda when I started with python development, but chose to switch to pyenv/virtualenv because I had some trouble with PyQt5 compatibility when I was developing VesselVio. Those compatibility issues have since gone away, but I've stayed with pyenv because it works well for me.

Having said this - I am able to use DLC with conda on my mac (Big Sur 11.6.5). Because DLC has so many other viable deployment options other than pyenv, I'm going to close this. No need to keep an unnecessary issue open :)

This issue can at least exist in case others try to use DLC with pyenv and can't figure out what's going on. The solution: don't be picky and just use conda!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants