Closed karinmcode closed 10 months ago
I copied video/images from the prepared behavioral_examples to the prepared_training_examples folder.
Now, I get a different error:
Perform augmentation for the behavior examples...
This might take hours or days, depending on the capacity of your computer.
2023-11-09 18:14:39.227315
Start to augment training examples...
Start to augment validation examples...
[ WARN:0@1153.251] global loadsave.cpp:248 findDecoder imread_('/Users/karinmorandell/Library/CloudStorage/GoogleDrive-karinmorandell.pro@gmail.com/My Drive/Research/Schneider lab/Paper/Karin paper version 230911/Reviewers requests/Fig 5 Automated behavior classification/LabGym-master/data/prepared_training_examples/13_resting.jpg'): can't open/read file: check file path/integrity
Traceback (most recent call last):
File "/Users/karinmorandell/miniconda3/envs/labgym/lib/python3.10/site-packages/LabGym/gui_categorizers.py", line 1079, in train_categorizer
CA.train_combnet(self.data_path,self.path_to_categorizer,self.out_path,dim_tconv=self.dim_tconv,dim_conv=self.dim_conv,channel=self.channel,time_step=self.length,level_tconv=self.level_tconv,level_conv=self.level_conv,aug_methods=self.aug_methods,augvalid=self.augvalid,include_bodyparts=self.include_bodyparts,std=self.std,background_free=self.background_free,behavior_mode=self.behavior_mode,social_distance=self.social_distance)
File "/Users/karinmorandell/miniconda3/envs/labgym/lib/python3.10/site-packages/LabGym/categorizers.py", line 1047, in train_combnet
test_animations,test_pattern_images,testY=self.build_data(test_files,dim_tconv=dim_tconv,dim_conv=dim_conv,channel=channel,time_step=time_step,aug_methods=aug_methods,background_free=background_free,behavior_mode=behavior_mode)
File "/Users/karinmorandell/miniconda3/envs/labgym/lib/python3.10/site-packages/LabGym/categorizers.py", line 379, in build_data
pattern_image=cv2.resize(pattern_image,(dim_conv,dim_conv),interpolation=cv2.INTER_AREA)
cv2.error: OpenCV(4.8.1) /Users/xperience/GHA-OpenCV-Python/_work/opencv-python/opencv-python/opencv/modules/imgproc/src/resize.cpp:4062: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
Hi,
These errors might be originated from the same cause: the path to the files was not properly read by sklearn or openCV. This might be because the google drive path contain some special characters like '@'. Have you tried to do these steps locally, or avoid including '@', '-', ' ', or '.' in your file directories?
Thank you very much. That solved my issue.
When attempting to train a categorizer clicking on the Train the Categorizer, a
ValueError
is raised due to an empty array of labelsy
.Thank you for your help.
Error message (short):
Error message: