Hi,
here you can can see a working implementation for grayscale images:
https://github.com/NVIDIA/DIGITS/blob/master/examples/siamese/README.md
Give it a try.
for line in yourFile.readlines():
line = line.strip()
line = line.replace(',','') # remove unneeded commas
lineElements = line.split(' ') # split line at spaces
# get relevant data
imageLeftPath = lineElements[0]
imageRightPath = lineElements[1]
label = lineElements[2]
images.append([imageLeftPath, imageRightPath, label])