Fix running gradient crashing sometimes (#2401)

This commit is contained in:
Adrià Arrufat 2021-08-04 19:59:42 +09:00 committed by GitHub
parent 16500906b0
commit bec25d8247
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1121,7 +1121,7 @@ namespace dlib
}
// if we haven't seen much data yet then just say false.
if (gradient_updates_since_last_sync < 30)
if (previous_loss_values_to_keep_until_disk_sync.size() < 30)
return false;
// if the loss is very likely to be increasing then return true