KumarLabJax / JABS-behavior-classifier

Behavior Classifier Component from the Jax Animal Behavior System
Other
11 stars 1 forks source link

Training in a different window size than initially trained gives error #6

Closed hessil closed 1 year ago

hessil commented 1 year ago

I successfully trained a JABS classifier with a mix of v5 and v3 pose on a window size of 5. When I try a different window size (tried with 10 and 15) I get this error:

Traceback (most recent call last):
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/feature_extraction/features.py", line 333, in get_window_features
    features = self.__load_window_features(window_size)
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/feature_extraction/features.py", line 265, in __load_window_features
    with h5py.File(path, 'r') as features_h5:
  File "/opt/anaconda3/envs/myenv/lib/python3.9/site-packages/h5py/_hl/files.py", line 424, in __init__
    fid = make_fid(name, mode, userblock_size,
  File "/opt/anaconda3/envs/myenv/lib/python3.9/site-packages/h5py/_hl/files.py", line 190, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  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 "h5py/h5f.pyx", line 96, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = '/Users/hessil/Desktop/socialvideos/rotta/features/NV1-B2B+2019-07-19_AM+19062002_2019-07-20_12-00-00_54000/0/window_features_15.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/ui/training_thread.py", line 54, in run
    features, group_mapping = self._project.get_labeled_features(
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/project/project.py", line 671, in get_labeled_features
    window_features = features.get_window_features(
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/feature_extraction/features.py", line 339, in get_window_features
    features = self.__compute_window_features(window_size)
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/feature_extraction/features.py", line 468, in __compute_window_features
    self._feature_modules[key].window(self._identity, window_size,
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/feature_extraction/feature_group_base_class.py", line 54, in window
    return {
  File "/Users/hessil/Downloads/JABS-behavior-classifier-main 2/src/feature_extraction/feature_group_base_class.py", line 55, in <dictcomp>
    name: mod.window(identity, window_size, per_frame_values[name]) for name, mod in
KeyError: 'distance_to_corner'
gbeane commented 1 year ago

Hi Leinani -- I can try to reproduce this and let you know what I find, but it will likely be a few days before I can get back to you

hessil commented 1 year ago

Issue is still occurring

`Traceback (most recent call last): File "/behavior-classifier/src/feature_extraction/features.py", line 337, in get_window_features features = self.load_window_features(window_size) File "/behavior-classifier/src/feature_extraction/features.py", line 266, in load_window_features with h5py.File(path, 'r') as features_h5: File "/usr/local/lib/python3.8/site-packages/h5py/_hl/files.py", line 507, in init fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr) File "/usr/local/lib/python3.8/site-packages/h5py/_hl/files.py", line 220, in make_fid fid = h5f.open(name, flags, fapl=fapl) 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 "h5py/h5f.pyx", line 106, in h5py.h5f.open FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = '/home/vivek/socialvideos/rotta/features/NV1-B2B+2019-07-19_AM+19062002_2019-07-20_12-00-00_54000/0/window_features_10.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/behavior-classifier/src/ui/training_thread.py", line 54, in run features, group_mapping = self._project.get_labeled_features( File "/behavior-classifier/src/project/project.py", line 671, in get_labeled_features window_features = features.get_window_features( File "/behavior-classifier/src/feature_extraction/features.py", line 343, in get_window_features features = self.compute_window_features(window_size) File "/behavior-classifier/src/feature_extraction/features.py", line 472, in compute_window_features self._feature_modules[key].window(self._identity, window_size, File "/behavior-classifier/src/feature_extraction/feature_group_base_class.py", line 54, in window return { File "/behavior-classifier/src/feature_extraction/feature_group_base_class.py", line 55, in name: mod.window(identity, window_size, per_frame_values[name]) for name, mod in KeyError: 'distance_to_corner'`

gbeane commented 1 year ago

resolved