jbohnslav / deepethogram

Other
98 stars 32 forks source link

IndexError: index out of range #150

Open ycwei0321 opened 1 year ago

ycwei0321 commented 1 year ago

[2023-08-16 11:43:57,980] INFO [main.feature_extractor_inference:475] configuration used in inference: [2023-08-16 11:43:57,996] INFO [main.feature_extractor_inference:476] split: reload: true file: null train_val_test:

[2023-08-16 11:43:57,996] INFO [main.feature_extractor_inference:481] Latent name used in HDF5 file: resnet18 [2023-08-16 11:43:58,089] INFO [deepethogram.data.augs.get_gpu_transforms:246] GPU transforms: {'train': Sequential( (0): ToFloat() (1): VideoSequential( (RandomHorizontalFlip_0): RandomHorizontalFlip(RandomHorizontalFlip(p=0.5, p_batch=1.0, same_on_batch=False)) (RandomRotation_1): RandomRotation(RandomRotation(degrees=10, p=0.5, p_batch=1.0, same_on_batch=False, resample=bilinear, align_corners=True)) (ColorJitter_2): ColorJitter(ColorJitter(brightness=0.25, contrast=0.1, saturation=0.1, hue=0.1, p=0.5, p_batch=1.0, same_on_batch=False)) (RandomGrayscale_3): RandomGrayscale(RandomGrayscale(p=0.5, p_batch=1.0, same_on_batch=False)) ) (2): NormalizeVideo() (3): StackClipInChannels() ), 'val': Sequential( (0): ToFloat() (1): NormalizeVideo() (2): StackClipInChannels() ), 'test': Sequential( (0): ToFloat() (1): NormalizeVideo() (2): StackClipInChannels() ), 'denormalize': Sequential( (0): UnstackClip() (1): DenormalizeVideo() )} [2023-08-16 11:43:58,089] INFO [main.feature_extractor_inference:515] gpu_transform: Sequential( (0): ToFloat() (1): NormalizeVideo() (2): StackClipInChannels() ) [2023-08-16 11:43:58,293] INFO [deepethogram.projects.get_weightfile_from_cfg:1079] loading specified weights: C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230816_013853_feature_extractor_train\lightning_checkpoints\epoch=19-step=17955.ckpt [2023-08-16 11:43:58,527] INFO [deepethogram.projects.get_weightfile_from_cfg:1079] loading specified weights: C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230816_013853_feature_extractor_train\lightning_checkpoints\epoch=19-step=17955.ckpt [2023-08-16 11:43:58,543] INFO [deepethogram.feature_extractor.train.build_model_from_cfg:220] feature extractor weightfile: C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230816_013853_feature_extractor_train\lightning_checkpoints\epoch=19-step=17955.ckpt [2023-08-16 11:43:58,683] INFO [deepethogram.utils.load_feature_extractor_components:630] loading component spatial from file C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230816_013853_feature_extractor_train\lightning_checkpoints\epoch=19-step=17955.ckpt [2023-08-16 11:43:59,074] INFO [deepethogram.utils.load_feature_extractor_components:630] loading component flow from file C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230816_013853_feature_extractor_train\lightning_checkpoints\epoch=19-step=17955.ckpt [2023-08-16 11:43:59,433] INFO [deepethogram.projects.get_weightfile_from_cfg:1079] loading specified weights: C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230815_232411_flow_generator_train\lightning_checkpoints\epoch=3-step=3999.ckpt [2023-08-16 11:43:59,433] INFO [deepethogram.utils.load_state:341] loading from checkpoint file C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230815_232411_flow_generator_train\lightning_checkpoints\epoch=3-step=3999.ckpt... [2023-08-16 11:43:59,449] INFO [deepethogram.utils.load_feature_extractor_components:630] loading component fusion from file C:\Users\shahlab\Desktop\Deepethogram\vole\habitation_test_deepethogram\models\230816_013853_feature_extractor_train\lightning_checkpoints\epoch=19-step=17955.ckpt [2023-08-16 11:43:59,558] INFO [main.feature_extractor_inference:545] best epoch from loaded file: 19 Traceback (most recent call last): File "C:\Users\shahlab\anaconda3\envs\deg\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\shahlab\anaconda3\envs\deg\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\shahlab\anaconda3\envs\deg\lib\site-packages\deepethogram\feature_extractor\inference.py", line 586, in feature_extractor_inference(cfg) File "C:\Users\shahlab\anaconda3\envs\deg\lib\site-packages\deepethogram\feature_extractor\inference.py", line 548, in feature_extractor_inference thresholds = f['val']['metrics_by_threshold']['optimum'][best_epoch, :] File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "C:\Users\shahlab\anaconda3\envs\deg\lib\site-packages\h5py_hl\dataset.py", line 758, in getitem return self._fast_reader.read(args) File "h5py_selector.pyx", line 361, in h5py._selector.Reader.read File "h5py_selector.pyx", line 151, in h5py._selector.Selector.apply_args IndexError: Index (19) out of range for (0-15) [2023-08-16 11:44:00,996] INFO [deepethogram.gui.main.featureextractor_infer:462] Inference finished. If you see error messages above, inference did not complete successfully.

Hello, I'm trying to run the deepethogram and it works very well with example videos. However, when I switched to my videos, it gave me the indexError when I was trying to run the featureextractor_inference. How can I fix it? Does anyone have good suggestions? Thanks.