Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com-train: Videos not detected- IndexError: list index out of range #53

Closed
harshk95 opened this issue Jul 8, 2021 · 2 comments
Closed

Comments

@harshk95
Copy link

harshk95 commented Jul 8, 2021

Hi,
I am trying to launch the COM train but receive the following error, seems to me the videos are not detected? There are 5 cameras and the videos are in .avi format.

(dannce) E:\DANNCE_test_210608>com-train C:\Users\realtime\dannce\configs\com_mouse_config.yaml
2021-07-08 18:51:47.037025: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
io_config not found in io.yaml file, falling back to main config
batch_size not found in io.yaml file, falling back to main config
epochs not found in io.yaml file, falling back to main config
downfac not found in io.yaml file, falling back to main config
lr not found in io.yaml file, falling back to main config
num_validation_per_exp not found in io.yaml file, falling back to main config
max_num_samples not found in io.yaml file, falling back to main config
com_finetune_weights not found in io.yaml file, falling back to main config
crop_height not found in io.yaml file, falling back to main config
crop_width not found in io.yaml file, falling back to main config
mono not found in io.yaml file, falling back to main config
com_train_dir set to: .\COM\train_results
com_predict_dir set to: .\COM\predict_results
dannce_train_dir set to: .\DANNCE\train_results\AVG
dannce_predict_dir set to: .\DANNCE\predict_results
dannce_predict_model set to: .\DANNCE\train_results\AVG\weights.1200-12.77642.hdf5
exp set to: [{'label3d_file': 'E:/DANNCE_test_210608/20210610_091000_Label3D_dannce.mat'}]
io_config set to: io.yaml
batch_size set to: 2
epochs set to: 3
downfac set to: 2
lr set to: 5e-5
num_validation_per_exp set to: 2
max_num_samples set to: max
com_finetune_weights set to: .\COM\weights
crop_height set to: [0, 960]
crop_width set to: [0, 576]
mono set to: True
base_config set to: C:\Users\realtime\dannce\configs\com_mouse_config.yaml
viddir set to: videos
camnames set to: None
n_channels_out set to: 1
sigma set to: 30
verbose set to: 1
net set to: unet2d_fullbn
gpu_id set to: 0
immode set to: vid
mirror set to: False
loss set to: mask_nan_keep_loss
num_train_per_exp set to: None
augment_hue set to: False
augment_brightness set to: False
augment_hue_val set to: 0.05
augment_bright_val set to: 0.05
augment_rotation_val set to: 5
data_split_seed set to: None
valid_exp set to: None
dsmode set to: nn
debug set to: False
augment_shift set to: False
augment_zoom set to: False
augment_shear set to: False
augment_rotation set to: False
augment_shear_val set to: 5
augment_zoom_val set to: 0.05
augment_shift_val set to: 0.05
start_batch set to: 0
n_channels_in set to: None
extension set to: None
n_views set to: 6
vid_dir_flag set to: None
chunks set to: None
lockfirst set to: None
load_valid set to: None
drop_landmark set to: None
raw_im_h set to: None
raw_im_w set to: None
n_instances set to: 1
start_sample set to: 0
write_npy set to: None
use_npy set to: False
com_predict_weights set to: None
com_debug set to: None
com_exp set to: None
Using the following *dannce.mat files: .\20210610_091000_Label3D_dannce.mat
Setting vid_dir_flag to True.
Setting extension to .avi.
Setting chunks to {'Camera1': array([], dtype=float64), 'Camera2': array([], dtype=float64), 'Camera3': array([], dtype=float64), 'Camera4': array([], dtype=float64), 'Camera5': array([], dtype=float64)}.
Traceback (most recent call last):
File "C:\Users\realtime\anaconda3\envs\dannce\Scripts\com-train-script.py", line 33, in
sys.exit(load_entry_point('dannce', 'console_scripts', 'com-train')())
File "c:\users\realtime\dannce\dannce\cli.py", line 41, in com_train_cli
params = build_clarg_params(args, dannce_net=False, prediction=False)
File "c:\users\realtime\dannce\dannce\cli.py", line 87, in build_clarg_params
params = infer_params(params, dannce_net, prediction)
File "c:\users\realtime\dannce\dannce\engine\processing.py", line 126, in infer_params
camf = os.path.join(viddir, video_files[0])
IndexError: list index out of range

Would appreciate help getting started. The labeling was done only for the whole skeleton. As per my understanding I did not need to manually annotate COM in label3D - just to confirm.

Thanks!

@diegoaldarondo
Copy link
Collaborator

diegoaldarondo commented Jul 8, 2021

Hey,

Yes, you are correct about the labeling.

I think the error is probably just a bug handling avi.

@spoonsso This line seems suspicious.

video_files = [f for f in video_files if ".mp4" in f]

solution might be as simple as
video_files = [f for f in video_files if extension in f]

@harshk95
Copy link
Author

Hi,
Yes, it is indeed just that line. Changing it leads to the movies being detected.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants