Couldn't connect to display "10.52.32.85:10.0"

When I run deeplabcut.check_labels(path_config_file) on Demo_labeledexample_MouseReaching.ipynb, error occurs as below.

Creating images with labels by Mackenzie.
/~/DeepLabCut/examples/Reaching-Mackenzie-2018-08-30/labeled-data/reachingvideo1_labeled  already exists!
---------------------------------------------------------------------------
TclError                                  Traceback (most recent call last)
<ipython-input-4-252bfc5b4110> in <module>()
      1 #Perhaps plot the labels to see how the frames were annotated:
----> 2 deeplabcut.check_labels(path_config_file)

~/.conda/envs/deeplabcut/lib/python3.6/site-packages/deeplabcut/generate_training_dataset/trainingsetmanipulation.py in check_labels(config, Labels, scale)
    252         try:
    253             DataCombined = pd.read_hdf(os.path.join(str(folder),'CollectedData_' + cfg['scorer'] + '.h5'), 'df_with_missing')
--> 254             MakeLabeledPlots(folder,DataCombined,cfg,Labels,Colorscheme,cc,scale)
    255         except FileNotFoundError:
    256             print("Attention:", folder, "does not appear to have labeled data!")

~/.conda/envs/deeplabcut/lib/python3.6/site-packages/deeplabcut/generate_training_dataset/trainingsetmanipulation.py in MakeLabeledPlots(folder, DataCombined, cfg, Labels, Colorscheme, cc, scale)
    263     for index, imagename in enumerate(DataCombined.index.values):
    264         image = io.imread(os.path.join(cfg['project_path'],imagename))
--> 265         plt.axis('off')
    266 
    267         if np.ndim(image)==2:

/opt/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py in axis(*v, **kwargs)
   1451            For setting the x- and y-limits individually.
   1452     """
-> 1453     return gca().axis(*v, **kwargs)
   1454 
   1455 

/opt/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py in gca(**kwargs)
    957     matplotlib.figure.Figure.gca : The figure's gca method.
    958     """
--> 959     return gcf().gca(**kwargs)
    960 
    961 # More ways of creating axes:

/opt/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py in gcf()
    586         return figManager.canvas.figure
    587     else:
--> 588         return figure()
    589 
    590 

/opt/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, clear, **kwargs)
    532                                         frameon=frameon,
    533                                         FigureClass=FigureClass,
--> 534                                         **kwargs)
    535 
    536         if figLabel:

/opt/anaconda3/lib/python3.6/site-packages/matplotlib/backend_bases.py in new_figure_manager(cls, num, *args, **kwargs)
    168         fig_cls = kwargs.pop('FigureClass', Figure)
    169         fig = fig_cls(*args, **kwargs)
--> 170         return cls.new_figure_manager_given_figure(num, fig)
    171 
    172     @classmethod

/opt/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py in new_figure_manager_given_figure(num, figure)
   1047         """
   1048         _focus = windowing.FocusManager()
-> 1049         window = Tk.Tk(className="matplotlib")
   1050         window.withdraw()
   1051 

/opt/anaconda3/lib/python3.6/tkinter/__init__.py in __init__(self, screenName, baseName, className, useTk, sync, use)
   2015                 baseName = baseName + ext
   2016         interactive = 0
-> 2017         self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
   2018         if useTk:
   2019             self._loadtk()

TclError: couldn't connect to display "10.52.32.85:10.0"

Could anyone tell me how to fix the display setting?. I use linux machine.

it seems you don’t have anaconda with screen access/does not have screen support so you need to export DLCLight=True first (see here: https://www.biorxiv.org/content/early/2018/11/24/476531)

you can also set, perhaps it was not set properly for some unclear reason matplotlib.use('Agg')

Thank you so much. I forgot to set up X server.

1 Like