Closed jiankang1991 closed 8 years ago
The shapes of each layer are computed using the shapes of the predecessor layers. Your images have most likely an undefined shape, yielding in an undefined shape of logits.
Use images.set_shape([360,480,3])
to set shape for images. This will give fcn_vgg.upscore32 a defined shape.
However one does not need to set the shape in advance. If it is not set, it is computed on runtime for each image. Commit fda8f40 modifies the loss to deal with abstract logits.shape
.
@MarvinTeichmann I have a similar problem and I have already identified that it is occurring due to the variable sized images that I should use for my model. When you said that if we don't set any definite shape in advance then it will be automatically computed during runtime then did you mean that that although when my snippet compiles it will give the error as mentioned by @karlTUM , but it will run properly when I actually fit my model with some training data ?
I build up the train graph and want to train the network, but
shape = [logits.get_shape()[0], num_classes]
cannot get shape of logits inloss.py
. The error is :my code is as follows:
It confuses me, why cannot tensorflow get the shape of upscore32? Thank you very much.