Newb having issues labeling frames

I’ve just started working with a test video and upon running the frame labeling GUI I receive the following error:

AttributeError: module ‘wx’ has no attribute ‘Thread_IsMain’

Here is the traceback

In [4]: deeplabcut.label_frames(config_path)
An exception has occurred, use %tb to see the full traceback.

SystemExit: This program needs access to the screen. Please run with a
Framework build of python, and only when you are logged in
on the main display of your Mac.

/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2855: UserWarning: To exit: use ‘exit’, ‘quit’, or Ctrl-D.
warn(“To exit: use ‘exit’, ‘quit’, or Ctrl-D.”, stacklevel=1)

In [5]:
Traceback (most recent call last):
File “/anaconda3/envs/dlc-macOS-CPU/bin/ipython”, line 11, in
sys.exit(start_ipython())
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/init.py”, line 125, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/traitlets/config/application.py”, line 658, in launch_instance
app.start()
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/terminal/ipapp.py”, line 353, in start
self.shell.mainloop()
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py”, line 459, in mainloop
self.interact()
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py”, line 442, in interact
code = self.prompt_for_code()
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py”, line 355, in prompt_for_code
pre_run=self.pre_prompt, reset_current_buffer=True)
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/prompt_toolkit/interface.py”, line 415, in run
self.eventloop.run(self.input, self.create_eventloop_callbacks())
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/prompt_toolkit/eventloop/posix.py”, line 102, in run
self._inputhook_context.call_inputhook(ready)
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/prompt_toolkit/eventloop/inputhook.py”, line 74, in call_inputhook
self.inputhook(self)
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py”, line 474, in inputhook
self._inputhook(context)
File “/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/terminal/pt_inputhooks/wx.py”, line 75, in inputhook_wx2
assert wx.Thread_IsMain()
AttributeError: module ‘wx’ has no attribute ‘Thread_IsMain’

If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with “%tb”, or use “%debug”
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True

(dlc-macOS-CPU) wifi-131-179-36-88:~ jobu$ 4;1R

Please see the user guide instructions, but in short, with Mac you need to launch the program with pythonw (not ipython).

Details here:

Thanks – I was just following the user guide directly, which indicates ipython… sorry, I’m not at all experienced with terminal/python.

Using pythonnw now… having issues getting past the initial new_project step, receiving “TypeError: create_new_project() missing 1 required positional argument: ‘videos’”… wasn’t having an issue with the same line of code when using ipython. Any ideas?

JB

you don’t have to re-create the project, fyi, you can just point back the config file.

Anyhow, without seeing what you typed in, I don’t know the error. There is otherwise no difference between in using the code with pythonw

Try to follow this example, but with paths to your own video files (on Mac you can drag the file/folder to terminal and it will automatically create the path)

pythonw

import deeplabcut

config_path=deeplabcut.create_new_project(‘project01’,‘experimenter’,[’/Users/jobu/Desktop/deeplabcut/videos/video1.avi’,’/Users/jobu/Desktop/deeplabcut/videos/video2.avi’,’/Users/jobu/Desktop/deeplabcut/videos/video3.avi’],working_directory=‘pathToWhereYouWantYourFolder’,copy_videos=False)

if you already have your new project with it’s designated folders and yaml file made, then when you want to reference it you just need to:

pythonw
import deeplabcut
config_path=‘path/config.yaml’

The path being wherever you have this config file in your directory. Might look like config_path=’/Users/jobu/desktop/deeplabcut/project01-Jobu-2019-06-24/config.yaml’

Thanks for your assistance! I was able to get things running this morning and learning is in process!

Cheers
JB

Things seem to working well… thanks for all your help! Will post again when issues arise!

J. Burda

1 Like