<p>You need to define your loss so that it does not consider the second portion of output if the first one is zero. If the image does not have a dot in it you may use an arbitrary number for the last 4 numbers, because if the first number is zero they are not considered in your loss. I hope this helps. </p>

<p>More readings: Object detection and the idea of anchor boxes in the Faster-RNN paper may help to understand how this might work: <a href="https://arxiv.org/pdf/1506.01497.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1506.01497.pdf</a></p>
How to train tensorflow model when some outputs do not matter?
<p>For example i want to train tensorflow model which has 2 outputs. If first output is 1 then i look at the second output, but if the first output is 0 then second output doesn't matter. Is there a way in tensorflow to set the error on second output to 0 when the first output is 0 or I have to specify all the outputs. Sorry if that is dumb question but I'm new to tensorflow.</p>

<p>Better example. I want to check if there is a dot in the feeded image. My model has 5 outputs. First one predict if there is a dot in the image(values from 0 to 1).The next 4 outputs shows where is that dot in the image (position, width and height). So if I feed a model with an image without dot what should i put in the output. [0,anything,anything,anything,anything] or [0,0,0,0,0]. And if the first one, how to do it.</p>