0
input_feats = Input(shape=([fc_feats.shape[0]]))
def lam_reshape(inputs):
    return inputs
fc_feats_new = Lambda(lam_reshape)(input_feats)
fc_feats_new = K.reshape(fc_feats_new, [10, int(fc_feats_new.shape[1])])
fc_feats_new = sess.run(fc_feats_new)

got error: InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'input_54' with dtype float and shape [?,2048]

4
  • You have a very similar question from yesterday: stackoverflow.com/questions/52816938/… Its better to update your question with new information than just asking a new one. Commented Oct 16, 2018 at 15:24
  • 1
    And secondly, what exactly are you trying to achieve with this code? You cannot evaluate a layer without an input. Commented Oct 16, 2018 at 15:24
  • Thanks Matias, so firstly the shape is (2048, ), I want to reshape it to (10, 2048), then convert it to numpy array. Commented Oct 16, 2018 at 23:00
  • 1
    You can't reshape (2048) into (10, 2048), because 2048 is not equal to 10 * 2048, and anyways you could do that in numpy, no need for kera to do this. As I said before, you can't compute outputs of layers without inputs. Commented Oct 17, 2018 at 8:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.