question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyError: 'val_acc' after first epoch - OSX

See original GitHub issue

Solutions in this thread: Title issue Using a specific model from a checkpoint, not the initial base model (important) Using the prediction function Pointing the prediction batch mode to test validation data Copying random files to validation


Original post:

The training script is crashing out early on with the following output:

`Found 7372 images belonging to 2 classes. Found 0 images belonging to 0 classes. Epoch 1/1000 103/103 [==============================] - 266s 3s/step - loss: 210.3966 - accuracy: 0.7679

Traceback (most recent call last): File “train-binary.py”, line 118, in <module> validation_steps=nb_validation_samples//batch_size) File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/legacy/interfaces.py”, line 91, in wrapper return func(*args, **kwargs) File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/engine/training.py”, line 1732, in fit_generator initial_epoch=initial_epoch) File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/engine/training_generator.py”, line 260, in fit_generator callbacks.on_epoch_end(epoch, epoch_logs) File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/callbacks/callbacks.py”, line 152, in on_epoch_end callback.on_epoch_end(epoch, logs) File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/callbacks/callbacks.py”, line 702, in on_epoch_end filepath = self.filepath.format(epoch=epoch + 1, **logs) KeyError: ‘val_acc’`

I’m not familiar enough with python to debug this properly and would appreciate any suggestions you might have

thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:25 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lmcasamcommented, Jan 14, 2020

Hi @cderinbogaz yes it would be cool to work together to see if we can come up with something more refined and interesting.

0reactions
tackeluacommented, Sep 22, 2020

@ashokballolli Did you run predict success?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convolutional Neural Net-Keras-val_acc Keyerror 'acc'
will gives a KeyError: 'acc' because you didn't set metrics=["accuracy"] in model.compile . This error also happens when metrics are not matched ...
Read more >
'acc' and KeyError: 'val_acc' Errors in Keras 2.3.x or Newer | by ...
If you're getting errors such as KeyError: 'acc' or KeyError: 'val_acc' in your Keras code, it may be due to a recent change...
Read more >
KeyError: 'epoch' · Issue #40 · fyu/drn - GitHub
I try to execute python3 -u /home/dl-box/ld/github/drn/segment.py test -d=/media/dl-box/HDD3/ld/Documents/datasets/CITYSCAPES -c=19 ...
Read more >
Google colaboratory - PIL - OS read error when loading a batch
I have installed PIL 4.1.1 which is required with torchvision. How do I solve this Google colaboratory PIL OS error? I have replaced...
Read more >
Time in milliseconds since epoch in the terminal - Ask Different
The date program in OS X is different than GNU's coreutils date program. You can install coreutils (including gnu-date), then you will have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found