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

Does it make sense that the validation loss is lower than training loss? #472

Closed
pengpaiSH opened this issue Aug 3, 2015 · 2 comments
Closed

Comments

@pengpaiSH
Copy link

I have used Keras for Kaggle-Facial Detection. When I plot the training and validation loss over epochs (depend on the callbacks.History), I find out that the validation loss is even lower than training loss. Does this make sense? As far as I understand, it should be a bit higher than training loss. Here is the plot.

image

@pengpaiSH
Copy link
Author

I think this is a sign of overfitting. After I add several dropout layers after convolutional layers, I get a more reasonable figure.
image

@rohun-tripathi
Copy link

fchollet pushed a commit that referenced this issue Sep 22, 2023
Not totally sure if we should merge this now, or wait for tf 2.14, but
figured I could put it up anyway so people could use it. With
tensorflow/tensorflow#59825
tf-nightly can be installed using cuda pip packages. Which means we
can write a recipe for cross framework GPU support.

To install a local development version...
```shell
pip install -r requirements-cuda.txt
python pip_build.py --install
```

To install the official pip version...
```shell
pip install -r requirements-cuda.txt
pip install keras-core --no-deps
```

Note that `--no-deps` is required to avoid pulling in `tensorflow` and
`tf-nightly` at the same time.

This should work in a clean python env, as long nvidia drivers are
>=520.61.05. No conda or cuda shenanigans required!
hubingallin pushed a commit to hubingallin/keras that referenced this issue Sep 22, 2023
Not totally sure if we should merge this now, or wait for tf 2.14, but
figured I could put it up anyway so people could use it. With
tensorflow/tensorflow#59825
tf-nightly can be installed using cuda pip packages. Which means we
can write a recipe for cross framework GPU support.

To install a local development version...
```shell
pip install -r requirements-cuda.txt
python pip_build.py --install
```

To install the official pip version...
```shell
pip install -r requirements-cuda.txt
pip install keras-core --no-deps
```

Note that `--no-deps` is required to avoid pulling in `tensorflow` and
`tf-nightly` at the same time.

This should work in a clean python env, as long nvidia drivers are
>=520.61.05. No conda or cuda shenanigans required!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants