pls always in error messages give the information what is expected and what you have gotten.
"Number of classes (%d) must match networks's number of outputs (%d)"