-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
AttributeError: 'ProgbarLogger' object has no attribute 'log_values' #3657
Comments
Can you post a minimal, short, standalone script to reproduce your issue? |
Thanks fchollet, I found the bug in my code. It should have been
It was trying to return an array with an invalid range something like: 500000-4900 |
Hi, I've the same error. I'm following this https://blog.keras.io/using-pre-trained-word-embeddings-in-a-keras-model.html tutorial for Using pre-trained word embeddings in a Keras model.
Respective code is ;
Can you please help me. |
For method fit() Keras should throw an exception when using validation_split and training set is ended up to be 0... Example: your last batch in epoch contains 1 sample and validation_split = 0.3 => training size = 0... |
It seems this is not solved yet. I uploaded Keras yesterday (2/6/2017) and the code is still raising this message: AttributeError: 'ProgbarLogger' object has no attribute 'log_values' |
Here's a self-contained example that reproduces the error. @fchollet , can we reopen this? Here's the output I get
|
I'm also getting the same error while training a four layer LSTM on small conversation corpus.epochs = 500 this gives out Train on 0 samples, validate on 1 samples AttributeError Traceback (most recent call last) ~/.local/lib/python3.5/site-packages/keras/models.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, **kwargs) ~/.local/lib/python3.5/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, **kwargs) ~/.local/lib/python3.5/site-packages/keras/engine/training.py in fit_loop(self, f, ins, out_labels, batch_size, epochs, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch) ~/.local/lib/python3.5/site-packages/keras/callbacks.py in on_epoch_end(self, epoch, logs) ~/.local/lib/python3.5/site-packages/keras/callbacks.py in on_epoch_end(self, epoch, logs) AttributeError: 'ProgbarLogger' object has no attribute 'log_values' |
Same error, and I tried removing validation_split from my fit command, but no change. |
Have you checked the dimensions for both ur x and y for train and test, I had a dimension issue with my y train. Generally the error arising if u tey to split data of incorrect size , say if it's 1, and u try to split it, it gives this error |
Ran into this issue today. saransh-mehta suggestion was the solution. Also ran into an issue where the number of samples for test/train split was not sufficient. train was 0 samples. |
If this is a common issue, we need a clear error message to handle it. Please open a PR to add appropriate error handling. |
Hi Guys, hope this information may help. regards, Yifei |
I also encountered this error today. Had to set |
Encountered this error when my training set was an empty array. Using Keras 2.0.9. A more descriptive error message might be helpful |
This happens if |
I got a similar issue when my training data set was empty after data cleaning and normalization. Might be worth checking you data set size before training. |
I've hit this error in Keras 2.1.5 as well. |
I also encountered this problem and I do not know how to solve it |
maybe this issue occurrence due to less train sample.increase more train sample can solve it |
Encountered this in 2.1.6 when supplying empty training set by mistake. IMHO the code should handle this gracefully. |
@kevkid @oswaldoludwig Im getting the same error though i have installed updated versions f keras and Theano mentioned above. Please help me out,how to overcome this issue? |
Set verbose=0:
Or make sure your dataset is bigger than the batch size. |
将batch_size设置为较小的数字。当您的batch_size设置为比样本集大小更大的值时,会出现此错误。 |
(using TensorFlow I would like to propose a code change to The Instead, place the initialization in
|
…arget'" (or 'log_values') error (keras-team#12898) (keras-team#12893) (keras-team#8944) This Change set is fixing two missing attribute bugs: * AttributeError: 'ProgbarLogger' object has no attribute 'target' keras-team#12898 Abstract reproduction scenario is provided in ticket * AttributeError: 'ProgbarLogger' object has no attribute 'log_values' keras-team#3657 * AttributeError: 'ProgbarLogger' object has no attribute 'log_values' keras-team#8944 (dup) Related changes: * Cases of regression are covered by tests. * Some potential bugs with same nature are prevented and covered by manifestation checks. * run with empty data array (but having valid shape) is now handled properly and yielding related warnings on callback and training routine level without execution fail Note: Changes that affect `ProgbarLogger` should be aware of following things: * proper target initialisation is requiring two attributes: `params` and `use_steps` to be defined * `use_steps` is guaranteed attribute the is set in the constructor (but could be altered after object instantiation. It's currently safe condition. * class `params` attribute could be altered between initialisation and training start. And current logic is made to be aware of this * we don't have `params` initialisation in constructor, this attribute will be assigned on call of `set_params` of base class somewhere on caller level (no strict guarantees :( ) * `seen` attribute is working in pair with `target` during `log_values` initialisation and their initialisation should be under the equal condition, currently thats not true * `if self.seen < self.target` condition is being checked whenever verbose mode value so both of them should be initialised without any conditions * `if self.seen < self.target` is checking for training iteration being not finished but in case of degenerate case with zero length it will not be called and `log_values` will stay not initialised but i don't see any explicit logic preventing using it on exit from 0-length training cycle and potentially it is the bug of some kind that is prevented on caller logic level * `progbar` attribute initialisation is definitely related to output verbosity (log values accumulation are not) and should be left under verbosity condition
Please, see PR with fix above. |
I also got this error. Because the number of training samples is smaller than 'batch_size'. |
Same error with my execution:
Traceback (most recent call last): |
I had the same error for the same code that was running efficiently a day before, I only changed the data -I increased it though- |
My guess is that the issue is not in how big is your training set, but rather the last batch size. Example: if the last batch has 3 samples, that gives you 2 samples for training set and 0 for validation (casted to integer). This is when you would see this exception. So, increase the last batch to the size where validation samples # will be > 0. Really surprised that the issue is not fixed for such a long time... |
I thought of this too, but actually it seemed that the problem was more trivial than so. |
JUST INCREASE NO_OF_EPOCHS |
I used a fixed step_per_epoch and the issues was resolved. You can play around number like 100 etc. Thanks |
Please make sure that the boxes below are checked before you submit your issue. Thank you!
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
I am performing batch learning and after a few batches I get this error from this line of code:
I have no idea why I get this error, It seems to happen randomly, can anyone point me in the right direction?
Here is the module of code that I am running:
The text was updated successfully, but these errors were encountered: