Skip to content

using Plotting=true FileNotFoundError: [Errno 2] No such file or directory:  #1563

@jonahpc

Description

@jonahpc

Is there an existing issue for this?

  • I have searched the existing issues

Bug description

when I let evalute_network(config_path, plotting=True) I get an error. This is not true when I have plot=False.

Operating System

Windows 10

DeepLabCut version

2.2.0.2

DeepLabCut mode

single animal

Device type

Geforce RTX 2080t

Steps To Reproduce

No response

Relevant log output

Running  DLC_resnet50_Right_Side_cameraOct28shuffle1_50000  with # of trainingiterations: 50000
C:\Users\Nischal\Anaconda3\envs\dlc2\lib\site-packages\tensorflow\python\keras\engine\base_layer_v1.py:1694: UserWarning: `layer.apply` is deprecated and will be removed in a future version. Please use `layer.__call__` method instead.
  warnings.warn('`layer.apply` is deprecated and '
Analyzing data...
42it [00:05,  7.30it/s]
Done and results stored for snapshot:  snapshot-50000
Results for 50000  training iterations: 95 1 train error: 2.67 pixels. Test error: 4.14  pixels.
With pcutoff of 0.6  train error: 2.67 pixels. Test error: 4.14 pixels
Thereby, the errors are given by the average distances between the labels by DLC and the scorer.
Plotting...
 43%|███████████████████████████████████▏                                              | 18/42 [00:05<00:06,  3.49it/s]
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_14292/4290122146.py in <module>
----> 1 deeplabcut.evaluate_network(path_config_file, plotting=True)

~\Anaconda3\envs\dlc2\lib\site-packages\deeplabcut\pose_estimation_tensorflow\core\evaluate.py in evaluate_network(config, Shuffles, trainingsetindex, plotting, show_errors, comparisonbodyparts, gputouse, rescale, modelprefix)
    896                             )
    897                             auxiliaryfunctions.attempttomakefolder(foldername)
--> 898                             Plotting(
    899                                 cfg,
    900                                 comparisonbodyparts,

~\Anaconda3\envs\dlc2\lib\site-packages\deeplabcut\pose_estimation_tensorflow\core\evaluate.py in Plotting(cfg, comparisonbodyparts, DLCscorer, trainIndices, DataCombined, foldername)
    199     fig, ax = visualization.create_minimal_figure()
    200     for ind in tqdm(np.arange(NumFrames)):
--> 201         ax = visualization.plot_and_save_labeled_frame(
    202             DataCombined,
    203             ind,

~\Anaconda3\envs\dlc2\lib\site-packages\deeplabcut\utils\visualization.py in plot_and_save_labeled_frame(DataCombined, ind, trainIndices, cfg, colors, comparisonbodyparts, DLCscorer, foldername, fig, ax, scaling)
    172         ax=ax,
    173     )
--> 174     save_labeled_frame(fig, image_path, foldername, ind in trainIndices)
    175     return ax
    176 

~\Anaconda3\envs\dlc2\lib\site-packages\deeplabcut\utils\visualization.py in save_labeled_frame(fig, image_path, dest_folder, belongs_to_train)
    191         full_path = "\\\\?\\" + full_path
    192     fig.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=0, hspace=0)
--> 193     fig.savefig(full_path)
    194 
    195 

~\Anaconda3\envs\dlc2\lib\site-packages\matplotlib\figure.py in savefig(self, fname, transparent, **kwargs)
   3013                 patch.set_edgecolor('none')
   3014 
-> 3015         self.canvas.print_figure(fname, **kwargs)
   3016 
   3017         if transparent:

~\Anaconda3\envs\dlc2\lib\site-packages\matplotlib\backends\backend_wx.py in print_figure(self, filename, *args, **kwargs)
    645     def print_figure(self, filename, *args, **kwargs):
    646         # docstring inherited
--> 647         super().print_figure(filename, *args, **kwargs)
    648         # Restore the current view; this is needed because the artist contains
    649         # methods rely on particular attributes of the rendered figure for

~\Anaconda3\envs\dlc2\lib\site-packages\matplotlib\backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
   2253                 # force the figure dpi to 72), so we need to set it again here.
   2254                 with cbook._setattr_cm(self.figure, dpi=dpi):
-> 2255                     result = print_method(
   2256                         filename,
   2257                         facecolor=facecolor,

~\Anaconda3\envs\dlc2\lib\site-packages\matplotlib\backend_bases.py in wrapper(*args, **kwargs)
   1667             kwargs.pop(arg)
   1668 
-> 1669         return func(*args, **kwargs)
   1670 
   1671     return wrapper

~\Anaconda3\envs\dlc2\lib\site-packages\matplotlib\backends\backend_agg.py in print_png(self, filename_or_obj, metadata, pil_kwargs, *args)
    507         """
    508         FigureCanvasAgg.draw(self)
--> 509         mpl.image.imsave(
    510             filename_or_obj, self.buffer_rgba(), format="png", origin="upper",
    511             dpi=self.figure.dpi, metadata=metadata, pil_kwargs=pil_kwargs)

~\Anaconda3\envs\dlc2\lib\site-packages\matplotlib\image.py in imsave(fname, arr, vmin, vmax, cmap, format, origin, dpi, metadata, pil_kwargs)
   1614         pil_kwargs.setdefault("format", format)
   1615         pil_kwargs.setdefault("dpi", (dpi, dpi))
-> 1616         image.save(fname, **pil_kwargs)
   1617 
   1618 

~\Anaconda3\envs\dlc2\lib\site-packages\PIL\Image.py in save(self, fp, format, **params)
   2235                 fp = builtins.open(filename, "r+b")
   2236             else:
-> 2237                 fp = builtins.open(filename, "w+b")
   2238 
   2239         try:

FileNotFoundError: [Errno 2] No such file or directory: '\\\\?\\E:/DLC2-Working/Right_Side_camera-JPC-2021-10-28\\evaluation-results\\iteration-0\\Right_Side_cameraOct28-trainset95shuffle1\\LabeledImages_DLC_resnet50_Right_Side_cameraOct28shuffle1_50000_snapshot-50000\\Training-A56M2_100PerXy_10min_in_1_awake_Right-img05711.png'

Anything else?

No response

Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions