Tensorflow error using my own data

后端 未结 2 1617
情话喂你
情话喂你 2020-12-09 11:52

I\'ve been playing with the Tensorflow library doing the tutorials. Now I wanted to play with my own data, but I fail horribly. This is perhaps a noob question but I can\'t

相关标签:
2条回答
  • 2020-12-09 12:23

    This error arises because the shape of the data that you're trying to feed (104 x 96 x 96 x 1) does not match the shape of the input placeholder (batch_size x 9216, where batch_size may be variable).

    To make it work, add the following line before running a training step:

    batch_xs = np.reshape(batch_xs, (-1, 9216))
    

    This uses numpy to reshape the images read in, which are 4-D arrays of batch_size x h x w x channels, into a batch_size x 9216 element matrix as expected by the placeholder.

    0 讨论(0)
  • 2020-12-09 12:31

    I solved this problem by upgrading tensorflow through pip.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题