question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Cannot feed value of shape

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
bleedingfightcommented, Jun 8, 2018

@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?

0reactions
bleedingfightcommented, Nov 7, 2018

有时间试一试!

来自 魅族 PRO 5

-------- 原始邮件 -------- 发件人:MaybeShewill-CV notifications@github.com 时间:周三 11月7日 10:26 收件人:MaybeShewill-CV/lanenet-lane-detection lanenet-lane-detection@noreply.github.com 抄送:bleedingfight bleedingfight@hotmail.com,Mention mention@noreply.github.com 主题:Re: [MaybeShewill-CV/lanenet-lane-detection] ValueError: Cannot feed value of shape (#6)

@bleedingfighthttps://github.com/bleedingfight 做了一些改进

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/MaybeShewill-CV/lanenet-lane-detection/issues/6#issuecomment-436481472, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK9m-abFzZKMWC3DbCHbwwyhHwDuL3bvks5uskTIgaJpZM4UfYE9.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TensorFlow ValueError: Cannot feed value of shape (64, 64, 3 ...
The problem is that you're feeding the placeholder with a value of a different shape. You have to feed it with a value...
Read more >
ValueError: Cannot feed value of shape (3,) for Tensor 'X:0 ...
I get the following error "ValueError: Cannot feed value of shape (2500, 1, 3) for Tensor 'X:0', which has shape '(1, 3)'". I...
Read more >
Cannot feed value of shape (50, 41) for Tensor u'Placeholder ...
showing ValueError: Cannot feed value of shape (50, 41) for Tensor u'Placeholder:0', which has shape. 1025 views. Skip to first unread message.
Read more >
Cannot feed value of shape (4, 198) for Tensor ... - Ray
I have a MA environment which returns states as lists with 177 components. I have checked that the returned states have the correct...
Read more >
Cannot feed value of shape (29,) for Tensor 'layer_6/bias ...
Hello, I want to start my DeepSpeech.py as root with: python3 DeepSpeech.py --train_files /media/sf_de/clips/train.csv --dev_files ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found