harvitronix / five-video-classification-methods

Code that accompanies my blog post outlining five video classification methods in Keras and TensorFlow
https://medium.com/@harvitronix/five-video-classification-methods-implemented-in-keras-and-tensorflow-99cad29cc0b5
MIT License
1.18k stars 478 forks source link

train.py crashes during run at "Creating test generator with n samples." #80

Closed ron-weiner closed 6 years ago

ron-weiner commented 6 years ago

Hello all! I tried using the train.py with the following configuration: model = lrcn class_limit = 2 nb_epoch = 2

And after a while at the "Creating test generator with n samples." I get an error.

later on I tried changing the parameters to: model = lrcn class_limit = 10 nb_epoch = 10

But unfortunately I got the same error.

I'm using python 3.6 on windows.

What can cause that?

Attached here the whole error:

Creating test generator with 243 samples. Traceback (most recent call last): File "train.py", line 110, in main() File "train.py", line 107, in main load_to_memory=load_to_memory, batch_size=batch_size, nb_epoch=nb_epoch) File "train.py", line 81, in train workers=4) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(*args, kwargs) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\models.py", line 1276, in fit_generator initial_epoch=initial_epoch) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(*args, *kwargs) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\engine\training.py", line 2244, in fit_generator max_queue_size=max_queue_size) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(args, kwargs) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\engine\training.py", line 2362, in evaluate_generator generator_output = next(output_generator) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\utils\data_utils.py", line 793, in get six.reraise(value.class, value, value.traceback) File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\six.py", line 693, in reraise raise value File "C:\Users\user\Anaconda3\envs\py36\lib\site-packages\keras\utils\data_utils.py", line 658, in _data_generator_task generator_output = next(self._generator) File "C:\Users\user\my_drive\code\five-video-classification-methods\data.py", line 26, in next return next(self.iterator) File "C:\Users\user\my_drive\code\five-video-classification-methods\data.py", line 180, in frame_generator frames = self.rescale_list(frames, self.seq_length) File "C:\Users\user\my_drive\code\five-video-classification-methods\data.py", line 259, in rescale_list assert len(input_list) >= size AssertionError

ron-weiner commented 6 years ago

Issue solved!

I was running it during the same time I still extracted to of the videos. After the extraction was finished I didn't get this error anymore. the error wasn't indicative but I'm positive that it was the reason.

sudonto commented 6 years ago

hi @ron-weiner , I have same problem with you. What do you mean by "extract the videos" ? Do you extract the feature or just exract the frame?

ron-weiner commented 6 years ago

hi @sudonto i meant simple extraction of the frames from videos did you manage?