How do I solve the generator object error and/or convert device type from cpu to cuda?

When I run that cell I can display the image but cannot get the prediction.