GradCam Problem

I tried the CAM code on my own on a different dataset but didn’t get the same output as that of the lab. Another thing is that i noticed that when I pass in the individual images, I get low prediction percentage but when I uses the entire test data , I get good prediction percentage ,Any help ?