GeorgeSeif / Semantic-Segmentation-Suite

Semantic Segmentation Suite in TensorFlow. Implement, train, and test new Semantic Segmentation models easily!
2.5k stars 880 forks source link

Error importing the image - !_src.empty() #176

Closed freddifederica closed 5 years ago

freddifederica commented 5 years ago

Information

Describe the problem

I am stuck with this problem every time I try to execute the train command described above as above:

Traceback (most recent call last):
  File "train.py", line 177, in <module>
    input_image = utils.load_image(train_input_names[id])
  File "/code/Semantic-Segmentation-Suite-master/utils/utils.py", line 45, in load_image
    image = cv2.cvtColor(cv2.imread(path,-1), cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/color.cpp:181: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

To give you a better idea of how it look and when it happens:

screenshot 2019-01-13 at 14 38 33

I also tried to look if there might have been an issue with the name of the files and if I might have something missing in the train and train_labels folder but it does not look so to me, this is the content of the two folders:

screenshot 2019-01-13 at 14 48 58

I am not really sure what is going on, could anyone help? Thanks a lot.

ryohachiuma commented 5 years ago

Did you try to print the path of input images and figure out which image is causing the error?

freddifederica commented 5 years ago

Solves, it was trying to open /code/Semantic-Segmentation-Suite-master/Dyson/train/.DS_Store Thanks

Maybe it would be nice to have a check on the file extension so to import only image format files.