Solved by ptrblck in post #10 
              
              
                What is the difference between the run in the terminal and your custom dataset? 
Apparently self.image_frame.loc[idx, 'location'] returns a str for the current idx. 
I would recommend to check the image_frame in an IDE and make sure the location column contains the expected values, which can be prop…