rizkiarm / LipNet

Keras implementation of 'LipNet: End-to-End Sentence-level Lipreading'
MIT License
635 stars 226 forks source link

OSError: [Errno 20] Not a directory: #37

Closed sf308 closed 6 years ago

sf308 commented 6 years ago

I ran the training script for random_split but I very time I run the script, I get an error telling that the video is "not a directory": /home/souheil/LipNet/training/random_split/train.py:69: UserWarning: Update your fit_generator call to the Keras 2 API: fit_generator(initial_epoch=0, verbose=1, generator=<lipnet.he..., workers=2, validation_data=<lipnet.he..., steps_per_epoch=7, epochs=20, callbacks=[<keras.ca..., max_queue_size=5, validation_steps=1, use_multiprocessing=True) pickle_safe=True) /usr/local/lib/python2.7/dist-packages/keras/engine/training.py:2023: UserWarning: Using a generator with use_multiprocessing=True and multiple workers may duplicate your data. Please consider using thekeras.utils.Sequence class. UserWarning('Using a generator withuse_multiprocessing=True`' 2018-01-18 14:32:30.901083: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA Epoch 0: Curriculum(train: True, sentence_length: -1, flip_probability: 0.5, jitter_probability: 0.05) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/keras/utils/data_utils.py", line 635, in data_generator_task generator_output = next(self._generator) File "/home/souheil/LipNet/lipnet/helpers/threadsafe.py", line 16, in next return self.it.next() File "/home/souheil/LipNet/lipnet/lipreading/generators.py", line 206, in next_train ret = self.get_batch(cur_train_index, self.minibatch_size, train=True) File "/home/souheil/LipNet/lipnet/lipreading/generators.py", line 148, in get_batch video = Video().from_frames(path) File "/home/souheil/LipNet/lipnet/lipreading/videos.py", line 114, in from_frames frames_path = sorted([os.path.join(path, x) for x in os.listdir(path)]) OSError: [Errno 20] Not a directory: '/home/souheil/LipNet/training/random_split/datasets/video/s1/swwv8p.mpg' Epoch 1/20 Traceback (most recent call last): File "/home/souheil/LipNet/training/random_split/train.py", line 73, in train(run_name, 0, 20, 3, 100, 50, 75, 32, 50) File "/home/souheil/LipNet/training/random_split/train.py", line 69, in train pickle_safe=True) File "/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py", line 87, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 2115, in fit_generator generator_output = next(output_generator) File "/usr/local/lib/python2.7/dist-packages/keras/utils/data_utils.py", line 735, in get six.reraise(value.class, value, value.traceback) File "", line 3, in reraise OSError: [Errno 20] Not a directory: '/home/souheil/LipNet/training/random_split/datasets/video/s1/swwv8p.mpg'

error-directory

Have any of you had this issue and if so how can it be resolved?

sf308 commented 6 years ago

Needed to use video = Video().from_video(path) instead

acarlos commented 5 years ago

Inside the file generators.py, line 147, change from_frames to from_video. Also, add ".split('.')[0]" to the end of the next line, 148, like this "align = self.get_align(path.split('/')[-1].split('.')[0])"