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

model.fit_generator to fit data into memory #555

Open
johnkorn opened this issue Jan 10, 2017 · 4 comments
Open

model.fit_generator to fit data into memory #555

johnkorn opened this issue Jan 10, 2017 · 4 comments

Comments

@johnkorn
Copy link

Hi, all!
I'm trying to train deep net on a big dataset that doesn't fit into memory.
Is there any way to use generators to read batches into memory on every training step?
I'm looking for behaviour similar to fit_generator method in Keras.

I know that in pure tensorflow following snippet can be wrapped by for loop to train on several batches:

batch_gen = generator(data)
batch = batch_gen.next()

sess.run([optm, loss, ...], feed_dict = {X: batch[0], y: batch[1]})
@aymericdamien
Copy link
Member

That is a good idea! While this get implemented, you can use image_preloader or hdf5 dataset to deal with that issue.

@gboeer
Copy link
Contributor

gboeer commented Jan 20, 2017

I have to say that especially the case of using large datasets wit tflearn is very poorly implemented (or maybe just badly documented ?).
In tf we have queues and file readers of all kinds but there is no easy way to supply queues to tflearn, or at least I couldn't find a way.

Regarding the hdf5 I cant do
from tflearn.data_utils import build_hdf5_image_dataset
ImportError: cannot import name 'build_hdf5_image_dataset'

Yes, I am using the latest version via
pip install --upgrade git+https://github.com/tflearn/tflearn.git

@iuria21
Copy link

iuria21 commented May 17, 2017

Hi, is it yet any fit_generator available? or we have to change to Keras?

@GEOFBOT
Copy link

GEOFBOT commented May 17, 2017

@imanoluria for now you can use regular TensorFlow to train a TFLearn network (which is what I've been doing)

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

No branches or pull requests

5 participants