1
votes

I updated pip and keras library but this seem to happen. I checked Keras documentation, and validation_freq doesn't seem to work. Is there any fix?

model.fit_generator(generator=train_generator, 
                              steps_per_epoch=steps_per_epoch, 
                              epochs=epochs, 
                              callbacks=[model_checkpoint, tensorboard_callback],
                              validation_data=validation_generator,
                              validation_steps=validation_steps,
                              validation_freq=[1, 2, 10])

Traceback (most recent call last): File "scripts/run_training.py", line 54, in validation_freq=[1, 2, 10]) File "/home/sherwin/.local/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(*args, **kwargs) TypeError: fit_generator() got an unexpected keyword argument 'validation_freq'

2

2 Answers

0
votes

Try to install keras from source as described in the documentation. Also uninstall other conda and pip versions of keras with "conda uninstall keras" and "pip uninstall keras".

https://keras.io/#installation

First, clone Keras using git: git clone https://github.com/keras-team/keras.git

Then, cd to the Keras folder and run the install command: cd keras sudo python setup.py install

0
votes

It has nothing to do with uninstalling keras, it just tells you that the argument you typed is not used in that function. Sometimes when they update functions in modules they change the names of some arguments just to make it hard to use code from old tutorials and more. Try to find what that atribute does and find the name of the attribute that does what you need.