I am not sure if we are the best to help you, since this does not seem to be a Fortran specific question rather a question about the app itself (?) I believe(?) you can read here on someone having a problem with the same code you’re trying to use.
Welcome to the forum! hopefully someone can help you, sorry that I don’t know about this much
Yes, you can train on a subset of digits from MNIST to predict only between two digits (3 and 7, for example). There is nothing special about there being 10 digits in the set. But you’d need to exclude images of other digits from the data.
Likewise for car/no car prediction. Any image dataset can have any number of labels (output kinds), it’s up to you and your application.