IndexError: index -1 is out of bounds for axis 0 with size 0

Hi, I’m having an issue when trying to analyse videos. This is happening for both 2D and 3D project files and I’ve seen this error across a few different projects in the past. Any help would be really appreciated, thanks in advance.

In [31]: deeplabcut.triangulate(config_path3d, 'D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos', filt
    ...: erpredictions=True, videotype='avi')
List of pairs: [['D:\\SinglePelletReach3D-Alex-2021-03-05-3d\\Videos\\YR29camera-1.avi', 'D:\\SinglePelletReach3D-Alex-2021-03-05-3d\\Videos\\YR29camera-2.avi']]
Analyzing video D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos\YR29camera-1.avi using config_file_camera-1
Using snapshot-300000 for model D:\DLC\FrontViewA1-Alex-2020-07-07\dlc-models\iteration-1\FrontViewA1Jul7-trainset95shuffle1
Initializing ResNet
2021-03-26 14:30:59.465011: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2021-03-26 14:30:59.495358: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-03-26 14:30:59.495606: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990]      0
2021-03-26 14:30:59.496082: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0:   N
2021-03-26 14:30:59.527829: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2931 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1650, pci bus id: 0000:01:00.0, compute capability: 7.5)
Starting to analyze %  D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos\YR29camera-1.avi
D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos  already exists!
Loading  D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos\YR29camera-1.avi
Duration of video [s]:  185.04 , recorded with  200.0 fps!
Overall # of frames:  37008  found with (before cropping) frame dimensions:  720 480
Starting to extract posture
  0%|                                                                        | 0/37008 [00:00<?, ?it/s]2021-03-26 14:31:04.218917: E tensorflow/stream_executor/cuda/cuda_dnn.cc:334] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
2021-03-26 14:31:04.219152: E tensorflow/stream_executor/cuda/cuda_dnn.cc:334] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
The videos are analyzed. Now your research can truly start!
 You can create labeled videos with 'create_labeled_video'
If the tracking is not satisfactory for some videos, consider expanding the training set. You can use the function 'extract_outlier_frames' to extract a few representative outlier frames.
D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos YR29camera-1 DLC_resnet_50_FrontViewA1Jul7shuffle1_300000
  1%|▌                                                            | 370/37008 [00:01<02:06, 290.77it/s]
Filtering with median model D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos\YR29camera-1.avi
No unfiltered data file found in D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos for video YR29camera-1 and scorer DLC_resnet_50_FrontViewA1Jul7shuffle1_300000.
Analyzing video D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos\YR29camera-2.avi using config_file_camera-2
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-31-c55d90e3d385> in <module>
----> 1 deeplabcut.triangulate(config_path3d, 'D:\SinglePelletReach3D-Alex-2021-03-05-3d\Videos', filterpredictions=True, videotype='avi')

D:\Programs\Anaconda\envs\DLC-GPU\lib\site-packages\deeplabcut\pose_estimation_3d\triangulation.py in triangulate(config, video_path, videotype, filterpredictions, filtertype, gputouse, destfolder, save_as_csv)
    271                         trainingsetindex=trainingsetindex,
    272                         gputouse=gputouse,
--> 273                         destfolder=destfolder,
    274                     )
    275                     scorer_name[cam_names[j]] = DLCscorer

D:\Programs\Anaconda\envs\DLC-GPU\lib\site-packages\deeplabcut\pose_estimation_tensorflow\predict_videos.py in analyze_videos(config, videos, videotype, shuffle, trainingsetindex, gputouse, save_as_csv, destfolder, batchsize, cropping, get_nframesfrommetadata, TFGPUinference, dynamic, modelprefix, c_engine, robust_nframes)
    208     Snapshots = Snapshots[increasing_indices]
    209
--> 210     print("Using %s" % Snapshots[snapshotindex], "for model", modelfolder)
    211
    212     ##################################################

IndexError: index -1 is out of bounds for axis 0 with size 0

In [32]:

Hello @AlexWillcox, is the project path correct in your config file? That is, does it correctly point to the location where the dlc-models folder and the network snapshots can be found?