p2irc / deepplantphenomics

Deep learning for plant phenotyping.
GNU General Public License v2.0
133 stars 46 forks source link

Classification test accuracy bugfix #30

Closed donovanlavoie closed 5 years ago

donovanlavoie commented 5 years ago

This fixes Issue #27, where classification training crashes during compute_full_test_accuracy.

Masking out excess values of the last test batch from all_losses, all_y, and all_predictions would fail since those lists are empty and unused for classification. The fix was simply to wrap the relevant sections of code in if-statements that check if the problem type is something other than classification.

The test suite still runs without issue and running the CIFAR10 classification example with the data in test_data now finishes without crashing.