Seyij / norman

A package for automation of the novel object recognition behavioural assay in neuroscience studies. The Novel Object Recognition Mouse Analysis Network (NORMAN) system.
GNU Lesser General Public License v3.0
7 stars 1 forks source link

Object_locs not found error #2

Open aliseena1 opened 9 months ago

aliseena1 commented 9 months ago

Hello! I hope you are doing well!

I am attempting to use Norman in conjunction with my DeepLabCut analysis. However, whenever I run the gui by selecting my video and corresponding csv file, it throws this error:

Exception in Tkinter callback Traceback (most recent call last): File "/Users/alidaeihagh/anaconda3/envs/dlc/lib/python3.8/tkinter/init.py", line 1892, in call return self.func(*args) File "/Users/alidaeihagh/anaconda3/envs/dlc/lib/python3.8/site-packages/norman_ai/norman_functions.py", line 1150, in run_analysis norkid1 = norkid(video_path, pose_path, no_location, ml_path) File "/Users/alidaeihagh/anaconda3/envs/dlc/lib/python3.8/site-packages/norman_ai/norman_functions.py", line 1029, in init self.relative_pos = rel_pos(pose_file, self.object_locs) AttributeError: 'norkid' object has no attribute 'object_locs'

When I try to work around this by drawing my own objects, I get this error:

2024-01-18 09:37:56.945157: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

AttributeError Traceback (most recent call last) Cell In[9], line 1 ----> 1 x = nf.norkid(video, poses, "left", draw_obj=True)

File ~/anaconda3/envs/dlc/lib/python3.8/site-packages/norman_ai/norman_functions.py:1031, in norkid.init(self, video, pose_file, no_loc, draw_obj, model_path) 1029 self.relative_pos = rel_pos(pose_file, self.object_locs) 1030 #get labels produced by the classification by norman -> 1031 self.labels = label_vid(self.relative_pos, model_path)
1032 #get the discrimination index, seconds spent with left or right, and fps 1033 self.di, self.tl, self.tr, self.fps = calc_di(video, self.labels, no_loc)

File ~/anaconda3/envs/dlc/lib/python3.8/site-packages/norman_ai/norman_functions.py:939, in label_vid(relative_pos, model_path) 936 norman_model = keras.models.load_model(model_path) 938 #use norman model from file to interpret relative position as classes --> 939 labels = norman_model.predict_classes(relative_pos) 941 #return the labels per frame 942 return labels

AttributeError: 'Sequential' object has no attribute 'predict_classes'

Do you know how I could go about fixing this issue? From what I can tell, I am working with the correct versions of all the packages utilized within the program. I have tried on both Mac and Windows computers as well. Thank you!