experiencor / speed-prediction

Use 3D convolutional network to predict the speed of a car via dashcam stream. The final mean squared error on validation set is 3.1 (mile/hour)^2.
40 stars 18 forks source link

Generator is not producing datasets #4

Open abramjos opened 6 years ago

abramjos commented 6 years ago

Hi everyone my generator is not producing images and stops with the first epoch

Epoch 1/5

StopIteration Traceback (most recent call last)

in () 6 validation_steps = gen_valid.get_size(), 7 callbacks = [early_stop, checkpoint, tensorboard], ----> 8 max_q_size = 8) 9 ~/anaconda3/lib/python3.5/site-packages/keras/legacy/interfaces.py in wrapper(*args, **kwargs) 85 warnings.warn('Update your `' + object_name + 86 '` call to the Keras 2 API: ' + signature, stacklevel=2) ---> 87 return func(*args, **kwargs) 88 wrapper._original_function = func 89 return wrapper ~/anaconda3/lib/python3.5/site-packages/keras/models.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 1154 use_multiprocessing=use_multiprocessing, 1155 shuffle=shuffle, -> 1156 initial_epoch=initial_epoch) 1157 1158 @interfaces.legacy_generator_methods_support ~/anaconda3/lib/python3.5/site-packages/keras/legacy/interfaces.py in wrapper(*args, **kwargs) 85 warnings.warn('Update your `' + object_name + 86 '` call to the Keras 2 API: ' + signature, stacklevel=2) ---> 87 return func(*args, **kwargs) 88 wrapper._original_function = func 89 return wrapper ~/anaconda3/lib/python3.5/site-packages/keras/engine/training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 2044 batch_index = 0 2045 while steps_done < steps_per_epoch: -> 2046 generator_output = next(output_generator) 2047 2048 if not hasattr(generator_output, '__len__'): then I checked the# ### **show(generator.__next __()[0][0][0])** and it returns: StopIteration Traceback (most recent call last) in () ----> 1 show(generator.__next__()) erator.__next__())
experiencor commented 6 years ago

Can you show the full error of show(generator.__next __()[0][0][0])? Your provided text is clipped somewhere.

One comment: you should run cell In [15]: to produce the images from the videos first.

abramjos commented 6 years ago

Sorry I tried a couple of times(the problem is not with generator function either) and find out that whenever I read images using opencv returns none( Type: NoneType String form: None Docstring: )

and thats why it cannot generate images. { I have my train/images directory with all the frames in it and I can watch the video feed too. kindof some other issues with conda/opencv(built in conda envs) and the gsettings(memory error is bursting out too)

and thank you so much for your kind words. may I know how you made the environment for the purpose.

experiencor commented 6 years ago

Are you install OPENCV using pip install opencv or something? I had this same error. I had to reinstall it using (https://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/).

abramjos commented 6 years ago

Thank you . I used a conda enviournment to build the model . but the whole thing broke somehow (with xdg/gsettings reinstallation and other errors) will get back to you once i complete this process!

On Wed, Nov 22, 2017 at 6:52 PM, Huynh Ngoc Anh notifications@github.com wrote:

Are you install OPENCV using pip install opencv or something. I had this same error. I had to install it again using (https://www.pyimagesearch. com/2016/10/24/ubuntu-16-04-how-to-install-opencv/).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/experiencor/speed-prediction/issues/4#issuecomment-346348527, or mute the thread https://github.com/notifications/unsubscribe-auth/AOrAC5wXHm0GBW1qshHJGPLZ1EO2rX6Kks5s5CAagaJpZM4QnC3q .

abramjos commented 6 years ago

Thank you I will get back to you once I complete this installation process I guess.

I used conda environment and build it(using make install) to get it working with ffmpeg.

abramjos commented 6 years ago

Hi I tried to build this using virtual environment and I could cmake and cmake install it but, I cannot import/find file cv2.so.

I went through root files of python 2&3 and cannot find this cv2.so as per the instructor. Conda is disabled during this binary compiling.

abramjos commented 6 years ago

Hi its working fine mahn! thanks :+1:

experiencor commented 6 years ago

Great! Hope that you go farther than me. My code works very well on validation set (3.4) but not that well on test set (31.4).