码迷,mamicode.com
首页 > 其他好文 > 详细

ValueError: Error when checking input: expected input_1 to have 2 dimensions, but got array with shape (100, 100, 100, 3)

时间:2019-07-08 16:42:55      阅读:984      评论:0      收藏:0      [点我收藏+]

标签:cep   when   trace   space   模型   cte   work   exce   功能   

  • 报错
Traceback (most recent call last):
  File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/1.Sequential与Model模型、Keras基本结构功能/2_1.py", line 22, in <module>
    model.fit(data,labels,epochs=3)
  File "D:\Anaconda3\lib\site-packages\keras\engine\training.py", line 952, in fit
    batch_size=batch_size)
  File "D:\Anaconda3\lib\site-packages\keras\engine\training.py", line 751, in _standardize_user_data
    exception_prefix='input')
  File "D:\Anaconda3\lib\site-packages\keras\engine\training_utils.py", line 128, in standardize_input_data
    'with shape ' + str(data_shape))
ValueError: Error when checking input: expected input_1 to have 2 dimensions, but got array with shape (100, 100, 100, 3)
  • 原因
    输入第一层的张量与数据集的shape不同
  • 解决
    shape参数写成:
    shape=data.shape

ValueError: Error when checking input: expected input_1 to have 2 dimensions, but got array with shape (100, 100, 100, 3)

标签:cep   when   trace   space   模型   cte   work   exce   功能   

原文地址:https://www.cnblogs.com/peng8098/p/11151953.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!