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

Recall always jumping to zero from first epoch #1

Open
Vamshigoud784 opened this issue Feb 10, 2021 · 3 comments
Open

Recall always jumping to zero from first epoch #1

Vamshigoud784 opened this issue Feb 10, 2021 · 3 comments

Comments

@Vamshigoud784
Copy link

Hi Nikhil,
Thanks for this UNET implementation.
I have followed exact steps in your tutorial and setup and gave all paths correctly.
I have used "train.py" and it is showing empty training data . are there any files me

Terminal log:
python train.py
Train: 4542 - 4542
Test: 1136 - 1136
Train for 379 steps, validate for 95 steps
Epoch 1/10
378/379 [============================>.] - ETA: 0s - loss: 0.0251 - mean_io_u: 1.0000 - recall: 0.0071 - precision: 0.2735
Epoch 00001: saving model to unet.h5
379/379 [==============================] - 273s 719ms/step - loss: 0.0251 - mean_io_u: 1.0000 - recall: 0.0071 - precision: 0.2735 - val_loss: 0.0086 - val_mean_io_u: 1.0000 - val_recall: 0.0000e+00 - val_precision: 0.0000e+00
Epoch 2/10
WARNING:tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least steps_per_epoch * epochs batches (in this case, 3790 batches). You may need to use the repeat() function when building your dataset.

Epoch 00002: saving model to unet.h5
WARNING:tensorflow:Reduce LR on plateau conditioned on metric val_loss which is not available. Available metrics are: lr
WARNING:tensorflow:Early stopping conditioned on metric val_loss which is not available. Available metrics are:
0/379 [..............................] - ETA: 0sTraceback (most recent call last):
File "train.py", line 62, in
callbacks=callbacks
File "/home/anaconda3/envs/UNET/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 819, in fit
use_multiprocessing=use_multiprocessing)
File "/home/anaconda3/envs/UNET/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_v2.py", line 342, in fit
total_epochs=epochs)
File "/home/anaconda3/envs/UNET/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_v2.py", line 187, in run_one_epoch
aggregator.finalize()
File "/home/anaconda3/envs/UNET/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_utils.py", line 144, in finalize
raise ValueError('Empty training data.')
ValueError: Empty training data.

@k-sashank
Copy link

In the data.py file, under the read_mask() function, there is a line:

x = x/255.0

Please comment that line or remove that line, compile the code and run again.
I am sure this will resolve the issue.

@nikhilroxtomar
Copy link
Owner

raise ValueError('Empty training data.') ValueError: Empty training data.

Please check the path of the dataset. The above error is because the dataset is empty and I think it is about the validation dataset.

@k-nayak
Copy link

k-nayak commented Aug 11, 2021

Is it possible to have real time segmentation without lag from the camera feed using U-net ?

When i try to feed a video or stream from camera there is huge lag in the feed when compared to just streaming without the model in openCV.

Anyway the lag can be reduced ?

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

4 participants