TensorFlow ValueError: Cannot feed value of shape (64, 64, 3) for Tensor u'Placeholder:0', which has shape '(?, 64, 64, 3)'

前端 未结 2 2046
一生所求
一生所求 2020-11-30 00:04

I am new to TensorFlow and machine learning. I am trying to classify two objects a cup and a pendrive (jpeg images). I have trained and exported a model.ckpt successfully. N

2条回答
  •  暖寄归人
    2020-11-30 00:17

    Powder's comment may go undetected like I missed it so many times,. So with the hope of making it more visible, I will re-iterate his point.

    Sometimes using image = array(img).reshape(a,b,c,d) will reshape alright but from experience, my kernel crashes every time I try to use the new dimension in an operation. The safest to use is

    np.expand_dims(img, axis=0)

    It works perfect every time. I just can't explain why. This link has a great explanation and examples regarding its usage.

提交回复
热议问题