Added exception for the case when no categories could be identified.

A frequent for this is a wrong path to the dataset folder.