dolongbien / HumanBehaviorBKU

Abnormal Human Behaviors Detection/ Road Accident Detection From Surveillance Videos/ Real-World Anomaly Detection in Surveillance Videos/ C3D Feature Extraction
157 stars 57 forks source link

IndexError: list index out of range #8

Closed cervantes-loves-ai closed 5 years ago

cervantes-loves-ai commented 5 years ago

when try to train the network, got this error

https://colab.research.google.com/drive/1FX8J7UioZKxuDAUz2y662_FJQ-bhXRu2

image

dolongbien commented 5 years ago

Hi, line 35 says that you might have the wrong input directory format. Recheck your input folder structure. Your mydrive/Train_RoadAccidents must have 2 directories similar to this:

.../mydrive/Train_RoadAccidents/

Put corresponding video feature files into those folders and try again.

cervantes-loves-ai commented 5 years ago

thank you for your quick response.

it seems that path of Normal and Abnotmal is ok,please have a look on my colab

https://colab.research.google.com/drive/1FX8J7UioZKxuDAUz2y662_FJQ-bhXRu2

image

dolongbien commented 5 years ago

The error is pretty obvious and it depends heavily on your directory as much as your files/hidden files. I think you should examine those file/directories again and print out the variable for debugging. Also, I'm not sure if the video counting code above has ignored the hidden files yet, so check it yourself.

dolongbien commented 5 years ago

Hi, the problem is that you have more than 2 folders in Train_RoadAccidents dir:

AllClassPath='/content/gdrive/My Drive/Colab Notebooks/Train_RoadAccidents/' output_dir='/content/gdrive/My Drive/Colab Notebooks/Train_RoadAccidents/Result/Weight/' loss_dir = '/content/gdrive/My Drive/Colab Notebooks/Train_RoadAccidents/Result/Loss'

This initialization will generate 3 folders inside Train_RoadAccidents dir, which is wrong. Create an independent directory for each of them (Result, Test_RoadAccidents folder) and make sure there are only 2 (Normal and Abnormal) folders in Train_RoadAccidents dir.

Hope this help.