LINCellularNeuroscience/VAME

behavior segmentation has no output

ktyssowski opened this issue · 3 comments

I was able to train the model with no errors, but when I run behavior_segmentation (like this: vame.behavior_segmentation(config, model_name='VAME', cluster_method='kmeans', n_cluster=[15,30,60])), it prints that it is computing latent space for each of my videos, but the results/<video_name>/<model_name> folder is empty, and I get the error message below, suggesting that it's not saving anything and therefore can't proceed. I have a large dataset (~1500 videos).


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/n/home06/ktyssowski/.local/lib/python3.7/site-packages/vame/analysis/segment_behavior.py", line 83, in behavior_segmentation
    z, z_logger = temporal_quant(cfg, model_name, files, use_gpu)
  File "/n/home06/ktyssowski/.local/lib/python3.7/site-packages/vame/analysis/segment_behavior.py", line 149, in temporal_quant
    z_temp = np.concatenate(x_decoded,axis=0)
ValueError: need at least one array to concatenate

It seems like somehow nothing gets encoded and x_decoded is empty which is why you get a ValueError.
To understand where the problem is, could you quickly put a print(X.shape) and print(z.shape) statement in line 130 and 146 respectively within the segment_behavior script. You do not need to run all your data, just a quick run to see what the shape is for an example dataset.

X.shape is (30,1349), and z.shape (printed many times) is (1,30)

ETA: it appears to have worked (i.e., segmentation ran without error) for my smaller test dataset (only 4 videos)

I figured this out -- there was very short video at the end of my list of videos that wasn't able to be read in correctly.