Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator is not producing datasets #4

Open
abramjos opened this issue Nov 22, 2017 · 8 comments
Open

Generator is not producing datasets #4

abramjos opened this issue Nov 22, 2017 · 8 comments

Comments

@abramjos
Copy link

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
Copy link
Owner

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
Copy link
Author

abramjos commented Nov 22, 2017

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
Copy link
Owner

experiencor commented Nov 22, 2017

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
Copy link
Author

abramjos commented Nov 22, 2017 via email

@abramjos
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Hi its working fine mahn!
thanks 👍

@experiencor
Copy link
Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants