I am trying to use fit_generator() on Spyder for training a Neural Network (which I want to train for sorting out digit's images) and I always have the same problem. When I call the function the first result that I have is this one:
and then:
Basically, I do not understand what happen this. I will attach the code's segment.
X_train, X_val, y_train, y_val = train_test_split(X_train, y_train, test_size=0.10, random_state=42)
batches = gen.flow(X_train, y_train, batch_size=64) # batches.n = 37800
val_batches = gen.flow(X_val, y_val, batch_size=64) # val_batches.n = 4200
history=model.fit_generator(generator=batches, steps_per_epoch=batches.n,
epochs=3, validation_data=val_batches,
validation_steps=val_batches.n)
Could someone help me?
Thanks in advance.
I had the exact same problem and spent a few days searching the net for solutions / reinstalling a couple of times / nearly throwing my laptop out / giving up and gathering hope again / finally finding a solution. Special thanks to this GitHub post
Here's the step-by-step solution to what I did. I'm using a MacBook and Anaconda for python / Spyder:
Anaconda Navigator > About Anaconda Navigator
states its Anaconda Navigator 1.9.6] conda install python=3.6
) so it would work with Keras [EDIT: This step may be redundant and not required] conda install nomkl
) (it asked to downgrade some packages to which I said ok) python -c "import sys; print(sys.executable)"
to get my path + copied the pathname Preferences > Python Interpreter > Use the following interpreter
where I input my path It all worked like a beauty. I can finally get on with learning more of this exciting field!
Just FYI... The first error image you get is not really an error, it's a warning that essentially means that the speed will not be as fast as it can be. The second image is the annoying error that took away a few days of my life to research a solution!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.