lanenet-lane-detection: ValueError: Cannot feed value of shape

Thanks for your share,I want to use your model to train my data,but raise some error: ValueError: Cannot feed value of shape (1, 256, 512, 3) for Tensor 'instance_input_label:0', which has shape '(?, 256, 512)',my works include:

  • draw different color on black background for instance segmentation(three channel),for example(10,10,10),(20,20,20),(30,30,30)…
  • draw white line on lane otherwise black(0,0,0),(255,255,255),(I try to use json file to draw line and then use cv2.imwrite to save,when i read the image,inspecte it’s shape,it’s channel is 3 even if the black backgroud is zeros(720,1280),3 channel image data is ok?).
  • generator data list for example:/xxx/image /xxx/gt_gray/gt_instance in train.txt and val.txt when i try to train from scrach,the code raise the error,if you can you tell me which step is error,i will appreciate for you help,thanks for your share too. @MaybeShewill-CV

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

@MaybeShewill-CV thanks for your kind help i read the imread’s flag:

IMREAD_UNCHANGED If set, return the loaded image as is (with alpha channel, otherwise it gets cropped).
IMREAD_GRAYSCALE If set, always convert image to the single channel grayscale image.
IMREAD_COLOR If set, always convert image to the 3 channel BGR color image.
IMREAD_ANYDEPTH If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.
IMREAD_ANYCOLOR If set, the image is read in any possible color format.
IMREAD_LOAD_GDAL If set, use the gdal driver for loading the image.

i can see IMREAD_UNCHANGED is set read as origin bit,but in your code,i can see: train_lanenet.py 108 line: label_img = cv2.imread(gt_label_path, cv2.IMREAD_COLOR) My understand is even if gt_label_path is 1 channel’s grayscale image,but i read is as 3 channel,which step my understand is wrong?