I do not know why the problem exists, exactly, but I found that casting to float64 seems to have solved it. I still wouldn’t mind a more detailed explanation as to what happened.
my solution:
image = self.pixel_frame.iloc[index, 1:].to_numpy(dtype='float64').reshape(1, -1)