-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
If you accidentally pass a string for video locations to add_new_videos() you get an uninformative error and DLC tries to slice the string.
Another side effect is that it creates a series of single-letter symlinks (for copy_videos=False) and a bunch of single-letter folders in the labelled-data folder.
Codes that causes the error:
import deeplabcut
config_file_path = "/gpfs/projects/acad/behavior/DLC_model/primary_DeepLabCut_model/LassanceLab-main-model-2023-09-14/config.yaml"
video_file_path = "/gpfs/projects/acad/behavior/videos/2023-11-13_conspecific_odor_videos/2023-09-15_test videos/Basler_acA1440-220um__40264738__20230912_112719915.mp4"
VideoType = 'mp4'
deeplabcut.add_new_videos(
config_file_path,
video_file_path,
copy_videos=True,
coords=None,
extract_frames=False,
)
Uninformative error message:
Copying the videos
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[12], line 1
----> 1 deeplabcut.add_new_videos(
2 config_file_path,
3 video_file_path,
4 copy_videos=True,
5 coords=None,
6 extract_frames=False,
7 )
File ~/.local/lib/python3.10/site-packages/deeplabcut/create_project/add.py:80, in add_new_videos(config, videos, copy_videos, coords, extract_frames)
78 else:
79 print("Copying the videos")
---> 80 shutil.copy(os.fspath(src), os.fspath(dst))
82 else:
83 # creates the symlinks of the video and puts it in the videos directory.
84 print("Attempting to create a symbolic link of the video ...")
File /gpfs/softs/easybuild/software/Python/3.10.4-GCCcore-11.3.0/lib/python3.10/shutil.py:417, in copy(src, dst, follow_symlinks)
415 if os.path.isdir(dst):
416 dst = os.path.join(dst, os.path.basename(src))
--> 417 copyfile(src, dst, follow_symlinks=follow_symlinks)
418 copymode(src, dst, follow_symlinks=follow_symlinks)
419 return dst
File /gpfs/softs/easybuild/software/Python/3.10.4-GCCcore-11.3.0/lib/python3.10/shutil.py:254, in copyfile(src, dst, follow_symlinks)
252 os.symlink(os.readlink(src), dst)
253 else:
--> 254 with open(src, 'rb') as fsrc:
255 try:
256 with open(dst, 'wb') as fdst:
257 # macOS
FileNotFoundError: [Errno 2] No such file or directory: 'g'