KumarLabJax / JABS-behavior-classifier

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

Can no longer train or classify #4

Closed hessil closed 2 years ago

hessil commented 2 years ago

I added new videos to my project folder from the same start frame and different durations (endframe). Since then, every time I train or classify, I get this error message:

`Traceback (most recent call last): File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/features.py", line 113, in init self.__load_from_file() File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/features.py", line 162, in __load_from_file raise PoseHashException src.pose_estimation.pose_est.PoseHashException

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/ui/training_thread.py", line 58, in run id_processed File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/project/project.py", line 660, in get_labeled_features extended_features=self._enabled_extended_features File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/features.py", line 117, in init self.__initialize_from_pose_estimation(pose_est) File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/features.py", line 132, in __initialize_from_pose_estimation self._feature_modules[key].per_frame(self._identity)) File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/feature_group_base_class.py", line 38, in per_frame feature_modules.items() File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/feature_group_base_class.py", line 37, in name: mod.per_frame(identity) for name, mod in File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/base_features/centroid_velocity.py", line 44, in per_frame centroids = [convex_hulls[i].centroid for i in indexes] File "/Users/hessil/Downloads/JABS-behavior-classifier-main/src/feature_extraction/base_features/centroid_velocity.py", line 44, in centroids = [convex_hulls[i].centroid for i in indexes] IndexError: list index out of range

` I attempted to delete the new videos, but still I get this error.

gbeane commented 2 years ago

There are a few files cached that are from the old pose file. If you remove all of these files, they will get regenerated with the correct length when you train again

delete these directories:

/rotta/cache/convex_hulls/ /rotta/features/ This exception is being thrown when trying to read the cached convex hulls. I can modify JABS to recompute the convex hulls if it encounters any kind of Exception when reading it in, but for now if you delete those directories you should be able to work with the project again.
hessil commented 2 years ago

Clearing the cache and features solved the issue