原文链接:http://www.one2know.cn/bug6/

  • 报错
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不同
  • 解决

    将data转置:

    data = data.reshape(len(data),-1)

    然后会报错:
ValueError: Error when checking input: expected input_1 to have shape (784,) but got array with shape (300,)

再把shape按照提示改正:

inputs = Input(shape=(300,))

ValueError: Error when checking input: expected input_1 to have 2 dimensions, but got array with shape (100, 100, 100, 3)的更多相关文章

  1. ValueError: Error when checking input: expected conv2d_1_input to have 4 dimensions, but got array with shape (60000, 28, 28)

    报错 Traceback (most recent call last): File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/3.构建各种神经网络/3.CNN ...

  2. Keras 报错: Error when checking target: expected dense_4...

    笔者此处是一个回归任务, 最后一层是: ... pred = Dense(1)(x) 在最后一个Dense层前加上x = Flatten()(x)即可.

  3. AspNetPager控件报错误: Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$Aspnetpager1_input问题解决[摘]

    高版本IE,如IE10或者IE11在浏览页面时出现错误: Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$ ...

  4. influxdb ERR: error parsing query: found -, expected

    ERR: error parsing query: found -, expected 使用时遇到这个问题,执行语句: select * FROM test10-cc-core01 本来以为和sql语 ...

  5. paramiko socket.error: Int or String expected

    paramiko socket.error: Int or String expected paramiko的环境: Python 2.6.6 paramiko==1.14.0 正常的paramiko ...

  6. eclipse spket插件 错误 Syntax error on token "(", FunctionExpressionHeader expected after this

    在myEclipse抵抗了两个小时后,终于被spket插件搞上了.其实上学期自己也学过Ext.js,哈哈..慕名而来的. 但当时功力不足,不得以要停止修炼.可现在不同,java的基础和j2ee的ssh ...

  7. JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xfe

    JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0xfe 在使用Jni ...

  8. 【Flink】flink执行jar报错:java.io.IOException: Error opening the Input Split file 或者 java.io.FileNotFoundException

    报错内容 flink执行jar时,报如下错误: org.apache.flink.client.program.ProgramInvocationException: Job failed. (Job ...

  9. ValueError: output parameter for reduction operation logical_and has too many dimensions ?

    https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.all.html#numpy.all 运行示例,却发生错误 import ...

随机推荐

  1. 【iOS】UIButton 常用属性

    发现 UIButton 的相关属性不熟悉了……常用的一些属性代码如下: UIButton *add = [UIButton buttonWithType:UIButtonTypeCustom]; ad ...

  2. Spring cloud 超时配置总结

    基准配置: eureka-server : 注册中心 端口号1000 service-A : 服务A端口号2000 service-B : 服务B 端口号3000 其中,B服务通过feign调用服务A ...

  3. A solution to the never shortened to-do list

    I once told my younger sister my learning system, and the basic five doctrines of my methodology. Bu ...

  4. JAVA基础知识(五)数据类型转换

     当使用 +.-.*./.%.运算操作时,遵循如下规则: 1.只要两个操作数中有一个是double类型的,另一个将会被转换成double类型,并且结果也是double类型: 2.如果两个操作数中有一个 ...

  5. Tomcat源码分析 (三)----- 生命周期机制 Lifecycle

    Tomcat里面有各种各样的组件,每个组件各司其职,组件之间又相互协作共同完成web服务器这样的工程.在这些组件之上,Lifecycle(生命周期机制)至关重要!在学习各个组件之前,我们需要看看Lif ...

  6. Linux系统关机与重新引导流程简介

    引言 在<Linux启动之旅>中,我们了解了Linux的启动过程,下面我们一同来学习Linux关机与重新引导流程. 不同于桌面系统,作为服务器,我们较少对Linux系统进行系统重启,但在以 ...

  7. jquery验证大全

    jQuery验证及限制 绑定键盘监听事件 $(document).on("keypress", ".txt-valid-len", function (e) { ...

  8. 【KakaJSON手册】04_JSON转Model_04_值过滤

    在KakaJSON手册的第2篇文章中提过:由于JSON格式能表达的数据类型是比较有限的,所以服务器返回的JSON数据有时无法自动转换成客户端想要的数据类型 比如客户端想要的是Date类型,服务器返回的 ...

  9. Lasso估计学习笔记(二)

    先看Lasso估计学习笔记(一),这篇是续的上一篇

  10. Python模块之netmiko

    一.简介 此模块用于简化paramiko与网络设备之间的ssh连接,可在windows与Unix平台使用 二.目前支持的设备 (2019.03.07) Regularly tested Arista ...