Mybatis 异常(SQL 语法异常 ambiguous)

【文本分析学习】Anaconda+pytorch虚拟环境下的pycharm文本分析(含分词、词性标注、词形归一化、停用词、文本情感分析、词频、文本相似度,附数据代码) NLTK 文本分析学习之 Anadconda+pytorch虚拟环境下的pycharm文本分析(含分词、词性标注、词形归一化、停用词、文本情感分析、词频、文本相似度,附数据代码) 阅读详情

内容

一、异常信息

严重: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘name’ in where clause is ambiguous
### The error may exist in com/yy/homework/mapper/EmployeeMapper.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select e.id, e.username, e.name, e.password, e.email, e.age, e.admin, e.dept_id, d.id d_id, d.name d_name, d.sn d_sn from employee e join department d on e.dept_id = d.id WHERE (name like concat(’%’, ? ,’%’) or e.email like concat(’%’, ? ,’%’)) limit ?, ?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘name’ in where clause is ambiguous
; ]; Column ‘name’ in where clause is ambiguous; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘name’ in where clause is ambiguous] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘name’ in where clause is ambiguous
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.Proxy53.execute(UnknownSource)atorg.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)atorg.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)atorg.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)atorg.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)atorg.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)atorg.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)atorg.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)atjava.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atjava.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atjava.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.base/java.lang.reflect.Method.invoke(Method.java:566)atorg.mybatis.spring.SqlSessionTemplateProxy53.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.mybatis.spring.SqlSessionTemplateProxy53.execute(UnknownSource)atorg.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)atorg.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)atorg.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)atorg.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)atorg.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)atorg.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)atorg.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)atjava.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atjava.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atjava.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.base/java.lang.reflect.Method.invoke(Method.java:566)atorg.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
at com.sun.proxy.Proxy44.selectList(UnknownSource)atorg.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)atorg.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)atorg.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)atorg.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)atcom.sun.proxy.Proxy44.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.Proxy44.selectList(UnknownSource)atorg.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)atorg.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)atorg.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)atorg.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)atcom.sun.proxy.Proxy45.selectAll(Unknown Source)
at com.yy.homework.service.impl.EmployeeServiceImpl.selectAll(EmployeeServiceImpl.java:32)
at com.yy.homework.web.controller.EmployeeController.selectAll(EmployeeController.java:36)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocolAbstractConnectionHandler.process(AbstractProtocol.java:589)atorg.apache.tomcat.util.net.JIoEndpointAbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpointAbstractConnectionHandler.process(AbstractProtocol.java:589)atorg.apache.tomcat.util.net.JIoEndpointSocketProcessor.run(JIoEndpoint.java:312)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

二、解决办法

1、造成原因

在这里插入图片描述
SQL语法错误,where 后面出现模棱两可的字段 name ,由于employee 和 department 中都存在 name,数据库不能识别你查询的是哪一个 name,所以报错。

2、解决

把 SQL 语句中 where 后面的 name 改成 e.name 或者 d.name,根据你需求来就好。

pygame系列教程——1.2加载及显示图片 Python之pygame系列教程(二)一、二、pygame版Hello,World! 在上一节中,我们了解了pygame的安装及体验了一下最基本的pygame程序。但是,创建窗口是制作图形化游戏的第一步。接下来,让我们来做一个小demo。 一、 我们默认你已经安装pycharm,且配置好基于python3.x的开发环境(如果还未配置,请参考我之前的教程)。打开pycharm的Terminal,输入 pip install pygame 这是最简单,最不易出错的一种方式,且不用区分操作系统的区别。安装完成 阅读详情

相关推荐

宏基因组分析|完整分析流程梳理

今天先从最基础的全流程框架说起,无论是刚接触的萌新,还是想查漏补缺的同行,都能找到有用的信息。

weixin_70911870的博客 3178

Error Code: 1052. Column ‘列名‘ in where clause is ambiguous

原文链接:https://blog.csdn.net/xiaoxiaovbb/article/details/80773082。这种错误主要是sql中出现多个表有列名重名的现象,而查询条件却没有指定选取那个表导致的这个问题。修改表名不重复,或是加上前面选择的是那个表就不会报这个问题。

loveLifeLoveCoding的博客 4137

农业杂草检测——棉花杂草数据集

然后将本层13×13的特征图谱经过×2上采样扩充到26×26,并与上层中26×26的特征图谱拼接,得到新的26×26的特征图谱,在该特征尺度上进行第二次预测,此时得到的特征图谱是相对输入图像16倍下采样,具有中尺度感受野,适合检测中等尺度对象;通过目标检测,能够及时清除杂草,减少病虫害的滋生和传播,保障棉花的健康生长,并有助于降低生产成本。对于地膜覆盖的棉田,由于膜内耕作层土温高、底墒好,杂草出苗早而集中,一般覆膜后5 - 7天杂草陆续出土,在墒情好的情况下,15天左右即形成出土高峰。

qq_38220914的博客 1256

Error Code: 1052. Column '列名' in where clause is ambiguous

这种错误主要是sql中出现多个表有列名重名的现象,而查询条件却没有指定选取那个表导致的这个问题。例如:表A和表B,两个表都有type这个字段做关联查询后:select * from A inner join B on A.a=B.b where type;就会出现上述问题。修改表名不重复,或是加上前面选择的是那个表就不会报这个问题...

任玉 9082

大模型系统构建的“三驾马车”——Prompt、Context与Harness工程

在LLM应用开发的早期阶段,我们热衷于比拼“提示词”的精妙程度。那时,一个精心构造的思维链CoT就能让模型的表现提升10%以上。随着大模型从“玩具”走向“生产系统”,我们逐渐意识到:单一的 Prompt 只是起点,而非终点。 真正的工业级应用,需要构建一套三层递进的工程体系——Prompt Engineering、Context Engineering 和 Harness Engineering。

西木风落 613

C#上位机开发:西门子/三菱PLC通信,新手直接上手

对着西门子S7协议文档看半天,连“DB块地址怎么写”都搞不懂;写三菱PLC代码时,分不清MC协议和Modbus的区别,代码改来改去连不上;好不容易跑通代码,换个PLC型号又报错,不知道哪里出问题;后来发现,新手学PLC通信根本不用先啃协议文档——先跑通“能通信”的代码,再慢慢理解底层逻辑,效率至少提升3倍。西门子PLC:用S7NetPlus库(新手最友好),实现以太网通信,支持S7-200 SMART/1200/1500;

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 890

Column ‘列名‘ in where clause is ambiguous

如果出现查询列名不明确 原因时 查询的表中有两个重复的字段 如果是直接sql查询 可以使用(表名或别名.字段名)的方式查询 如果是在代码中 可以在实体类中添加属性映射的字段名 使用@TableField(‘列名’) 注解指定即可 ...

lady132的博客 1312

华为od统一考试B卷【食堂供餐】Python 实现

某公司员工食堂以盒饭方式供餐。为将员工取餐排队时间降低为0,食堂的供餐速度必须要足够快。现在需要根据以往员工取餐的统计信息,计算出一个刚好能达成排队时间为0的最低供餐速度。即,食堂在每个单位时间内必须至少做出多少份盒饭才能满足要求。

MISAYAONE的博客 8791

mysql查询出现ambiguous的问题

MySQL查询语句如下: SELECT `addr` FROM `table1` LEFT JOIN `table2` ON `table2`.`id`=`table1`.`id` WHERE `name` = 'James' 查询出错:Column 'name' in where clause is ambiguous ambiguous,就是模糊不清的意思; 正确查询语

u014433030的专栏 1万+

【乐企-工具篇】有关乐企发票文件生成- OFD和PDF文件生成

有关乐企发票文件生成-OFD和PDF文件生成

九七的博客 2063

STM32电机测速(正交或者霍尔编码器)

2.2 STM32电机测速(正交或者霍尔编码器) 我们这里提供左右电机测速代码,在公众号:小白学移动机器人,发送:电机测速,即可获得源码工程下载链接。 2.2.1 实现工具 STM32单片机、带编码器的直流减速电机、Keil5、(蓝牙、串口助手)调试用 2.2.2 编码器原理 (1)编码器是什么? 编码器是一种将角位移或者角速度转换成一串电数字脉冲的旋转式传感器。编码器又分为光电编码器和霍尔编码器。 (2)编码器工作原理是什么? 霍尔编码器是有霍尔马盘和霍尔元件组成。霍尔马盘是在一定直径的圆板上等分的布置有

「小白学移动机器人」一个专注分享移动机器人相关知识的公众号! 6万+

mybaits错误 MySQLIntegrityConstraintViolationException: Column ‘name‘ in where clause is ambiguous...

问题:多表查询,where后的字段没有指定表造成的,检查你的Wrapper中的sql字段。记得联表的时候把t1标注上,有时候自己比较粗心,这个问题也是报错的原因之一。

m0_75134325的博客 409

802.11be 的“上帝视角”:深入解析 CSI 技术原理与实现

IEEE 802.11be标准下的CSI技术解析 摘要:本文深入解析了802.11be标准中的信道状态信息(CSI)技术。CSI作为无线通信的"高精度地图",通过显式反馈机制获取信道矩阵H,经SVD分解得到预编码矩阵V。802.11be在CSI反馈机制上实现重大改进:支持320MHz带宽、16空间流;引入灵活的子载波分组(Ng=4/16)、更高量化精度(最高9/7比特)、部分带宽反馈和触发式反馈。这些创新显著提升了MU-MIMO和波束成形性能,为Wi-Fi 7带来极速通信、精准感知和Me

1042484520@qq.com(邮箱) 214

Mybatis-Plus 3.4.x版本多租户关联SQL查询clause is ambiguous异常

Mybatis-Plus 3.4.x版本多租户关联SQL查询异常 Column 'tenant_id' in where clause is ambiguous异常问题处理 Select部分的嵌套查询(子查询)拼接租户id 启用多租户插件后发现在插入语句中tenant_id字段重复问题

Along1325的博客 2496

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

MyBatis3 & xxx is ambiguous in Mapped Statements collection异常

MyBatis3 模糊查询 & xxx is ambiguous in Mapped Statements collection异常 转载 模糊查询: 工作中用到,写三种用法吧   1. sql中字符串拼接    SELECT * FROM tableName WHERE name LIKE CONCAT(CONCAT('%', #{text}), '%'); ...

jiangfeng0213的专栏 558

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

Mybatis异常

Mybatis异常合集 Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘id’ in order clause is ambiguous ;Column ‘id’ in order clause is ambiguous; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintV

尽力漂亮的博客 1081

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

mybatis异常ambiguous in Mapped Statements collection 解决方法

Error querying database.  Cause: java.lang.IllegalArgumentException: FindById is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entrie...

Twenty-Seven的博客 1万+

Column 'pid' in where clause is ambiguous

Caused by: java.sql.SQLIntegrityConstraintViolationException: Column 'pid' in where clause is ambiguous at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) at com.my...

tan_yh的专栏 677

Caused by: java.lang.IllegalStateException: Ambiguous mapping

出现 “Ambiguous mapping” 异常通常是因为存在多个相同名称的映射器方法或者映射器文件中存在重名的查询等情况。这样会导致 MyBatis 在执行时无法确定使用哪个方法或查询,从而抛出异常。检查您的映射器接口(Mapper Interface)和映射器 XML 文件,确保不存在同名的方法或查询。确保在调用 MyBatis 查询方法时,指定了唯一的方法名称,避免多个方法有相同的名称。如果出现了多个相同名称的映射器方法或查询,尝试对它们进行重命名或者调整,以保证唯一性。

weixin_73330164的博客 1570

MySQLIntegrityConstraintViolationException: Column 'ID' in where clause is ambiguous

MySQLIntegrityConstraintViolationException: Column ‘ID’ in where clause is ambiguous 原文地址:http://blog.csdn.net/u011731544/article/details/78986593 Error querying database. Cause: com.mysql.jdbc.exc

Create_Myths的博客 1027

MyBatis中的PersistenceException

Mybatis学习过程中的错误记录程序测试中的两种PersistenceException第一种第二种 程序测试中的两种PersistenceException 第一种 org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession. The error may exist in SQL Mapper Con...

qq_34200509的博客 4216

count is ambiguous in Mapped Statements collection (try using the full name including the namespace,...

各位老铁们: 遇到这种问题怎么办? {"callbackType":"","forwardUrl":"","message":":错误信息:底层异常,错误信息:数据库底层异常,错误信息:数据操作失败,错误信息:\r\n### Error querying database. Cause: java.lang.IllegalArgumentException: count is ambiguous...

weixin_34273481的博客 1660

MySQLIntegrityConstraintViolationException: Column 'id' in field list is ambiguous

今天写代码碰到了这样一个问题:MySQLIntegrityConstraintViolationException: Column 'id' in field list is ambiguous。一看就是死在了mybatis的配置文件上了。因为人家说的是列属性“id”在所属领域中定义不明确。       进入XML文件中查找“id”果然在连接查询中发现了问题,一般ID是多数表的共有属性,联表查询

游语 8454

mybatis报错合集!!!!

1.Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.mtsbw.ma.wms.newErp.dao.productWeight.IAddProdWeightDaogetIdByNum解决方法...

qq_32844875的博客 7713

一个 is 开头的方法导致的错误:Lombok、MyBatis 与 Spring Security 下的 JavaBeans 属性名陷阱与 TaoToken 配置排查

Java 项目里一个 is 开头的方法可能同时触发 MyBatis 与 Spring Security 的 JavaBeans 属性名冲突,报 Illegal overloaded getter method。本文拆解 Lombok 生成 getter 的规则,给出 DTO 改名、resultMap 显式绑定与 SpEL 对齐写法,并附 TaoToken 统一 Key 配置排查路径,官网见 https://taotoken.net/?utm_source=taotoken_aicg_blog_end 。

weixin_42600407的博客 227

常见的 MyBatis 错误

常见的 MyBatis 错误 Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘name’ in ‘field list’ The error may involve defaultParameterMap The error occu...

XieFeiFei01的博客 1278
上一篇: 单例模式的5种实现方式(懒汉模式、饿汉模式、双重锁模式、静态内部类模式、枚举模式)
下一篇: SpringMVC异常(404,接收参数类型转换错误)
Yan Yang
博客等级 码龄9年 2万+粉丝 143原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值