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

Fit Generator Issue #5

Open
krishnaprasad1996 opened this issue Oct 18, 2017 · 0 comments
Open

Fit Generator Issue #5

krishnaprasad1996 opened this issue Oct 18, 2017 · 0 comments

Comments

@krishnaprasad1996
Copy link

//==================================================================
Hello Mam,
I am planning to do a project on behavioral cloning, and I have been following your open source tutorial since then. I am a newbie to deep learning. I've been struck in this step for about a week. I am really sorry if this is a dumb question. Than you in advance for your great help.
//==================================================================

batch_size = 32
nb_epoch = 20

checkpointer = ModelCheckpoint(filepath="./tmp/comma-4c.{epoch:02d}-{val_loss:.2f}.hdf5", verbose=1, save_best_only=False)

model.fit_generator(train_generator,
samples_per_epoch=len(train_samples),
validation_data=validation_generator,
nb_val_samples=len(validation_samples), nb_epoch=nb_epoch,
callbacks=[checkpointer])
//==================================================================
//==================================================================
//==================================================================

C:\Users\krish\Anaconda3\lib\site-packages\ipykernel_launcher.py:10: UserWarning: The semantics of the Keras 2 argument steps_per_epoch is not the same as the Keras 1 argument samples_per_epoch. steps_per_epoch is the number of batches to draw from the generator at each epoch. Basically steps_per_epoch = samples_per_epoch/batch_size. Similarly nb_val_samples->validation_steps and val_samples->steps arguments have changed. Update your method calls accordingly.

Remove the CWD from sys.path while we load stuff.

C:\Users\krish\Anaconda3\lib\site-packages\ipykernel_launcher.py:10: UserWarning: Update your fit_generator call to the Keras 2 API: fit_generator(<generator..., validation_data=<generator..., callbacks=[<keras.ca..., steps_per_epoch=614, epochs=20, validation_steps=33)

Remove the CWD from sys.path while we load stuff.

Epoch 1/20

Exception in thread Thread-6:
Traceback (most recent call last):
File "C:\Users\krish\Anaconda3\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Users\krish\Anaconda3\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\krish\Anaconda3\lib\site-packages\keras\utils\data_utils.py", line 568, in data_generator_task
generator_output = next(self._generator)
File "", line 13, in generator
center_image = mpimg.imread(name)
File "C:\Users\krish\Anaconda3\lib\site-packages\matplotlib\image.py", line 1278, in imread
im = pilread(fname)
File "C:\Users\krish\Anaconda3\lib\site-packages\matplotlib\image.py", line 1256, in pilread
with Image.open(fname) as image:
File "C:\Users\krish\Anaconda3\lib\site-packages\PIL\Image.py", line 2477, in open
fp = builtins.open(filename, "rb")
OSError: [Errno 22] Invalid argument: './data/C:\Users\krish\Desktop\IMG\center_2017_10_17_19_10_50_094.jpg'


StopIteration Traceback (most recent call last)
in ()
8 validation_data=validation_generator,
9 nb_val_samples=len(validation_samples), nb_epoch=nb_epoch,
---> 10 callbacks=[checkpointer])

~\Anaconda3\lib\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\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, initial_epoch)
1119 workers=workers,
1120 use_multiprocessing=use_multiprocessing,
-> 1121 initial_epoch=initial_epoch)
1122
1123 @interfaces.legacy_generator_methods_support

~\Anaconda3\lib\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\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)
2009 batch_index = 0
2010 while steps_done < steps_per_epoch:
-> 2011 generator_output = next(output_generator)
2012
2013 if not hasattr(generator_output, 'len'):

StopIteration:

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

1 participant