草庐IT

invalid-argument

全部标签

c++ - OpenCV SVM 在火车上抛出异常, "Bad argument (There is only a single class)"

我卡在这个了。我正在尝试通过OpenCV特征2d框架进行一些对象分类,但在训练我的SVM时遇到了麻烦。我能够提取词汇表并使用BowKMeansTrainer对它们进行聚类,但在我从训练数据中提取特征以添加到训练器并运行SVM.train方法后,出现以下异常。OpenCVError:Badargument(Thereisonlyasingleclass)incvPreprocessCategoricalResponses,file/home/tbu/prog/OpenCV-2.4.2/modules/ml/src/inner_functions.cpp,line729terminatec

c++ - std::map.insert "could not deduce template argument for..."

我正在尝试熟悉STL库,但我无法理解我的编译错误。我使用编译器错误字符串“无法推断...的模板参数”搜索了其他问题,但没有一个答案似乎适用或相关。Error4errorC2784:'boolstd::operator&,conststd::unique_ptr&)':couldnotdeducetemplateargumentfor'conststd::unique_ptr&'from'conststd::string'c:\programfiles(x86)\microsoftvisualstudio10.0\vc\include\xfunctional125我正在编写一个简单的解释

c++ - "more than one instance of overloaded function "标准::战俘 "matches the argument list"

使用C++,我尝试#defineTINYstd::pow(10,-10)我为定义了TINY的类(.h)提供了带有#include和命名空间信息的代码#pragmaonce#include"MMath.h"#include#include#includeusingnamespacestd;#defineTINYstd::pow(10,-10)我在.cpp文件中的一些函数实现中使用了TINY,而TINY给出了错误IntelliSense:morethanoneinstanceofoverloadedfunction"std::pow"matchestheargumentlist什么是正确的

c++ - 构造函数中的奇怪 "candidate expects 1 argument, 0 provided"

我正在用C++制作一个简单的线程服务器应用程序,事实上,我使用libconfig++来解析我的配置文件。好吧,libconfig不支持多线程,因此我使用两个包装类来完成“支持”。重点是,其中一个失败了:classapp_config{friendclassapp_config_lock;public:app_config(char*file):cfg(newlibconfig::Config()),mutex(newboost::mutex()){cfg->readFile(file);}private:boost::shared_ptrcfg;boost::shared_ptrmut

c++ - "BUS_ADRALN - Invalid address alignment"错误是什么意思?

我们在HPUX上,我的代码在C++中。我们得到了BUS_ADRALN-Invalidaddressalignment在我们的函数调用中的可执行文件中。这个错误是什么意思?相同的功能运行了很多次,然后突然出现了核心转储。在GDB中,当我尝试打印它不在上下文中的对象值时。知道在哪里检查吗? 最佳答案 您遇到了数据对齐问题。这可能是由于尝试通过某种错误的指针读取或写入造成的。数据对齐问题是指指针指向的地址未正确“对齐”。例如,某些体系结构(例如旧的Cray2)要求任何从内存中读取除单个字符以外的任何内容的尝试只能通过指针值的最后3位为0的

Docker408错误:Error response from daemon: error parsing HTTP 408 response body: invalid character ‘<‘

错误现象:Usingdefaulttag:latestErrorresponsefromdaemon:errorparsingHTTP408responsebody:invalidcharacter'408RequestTime-out\nYourbrowserdidn'tsendacompleterequestintime.\n\n\n"解决办法:此时需要修改当前网卡的MTU为900#临时修改:ifconfigeth0mtu900#永久修改(尝试设置,但是失败了...):#vi/etc/network/interfaces#【在最后增加内容:mtu900】...【然后重启网卡】/etc/in

使用 curator 连接 zookeeper 集群 Invalid config event received

dubbo整合zookeeper如图,错误日志2023-11-0421:16:18.699ERROR7459[main-EventThread]org.apache.curator.framework.imps.EnsembleTrackerCaller+0atorg.apache.curator.framework.imps.EnsembleTracker.processConfigData(EnsembleTracker.java:214)-Invalidconfigeventreceived:{server.1=master:2888:3888:participant,version=0

c++ - 海湾合作委员会错误 : invalid conversion from double* to const double

我使用的是gcc4.5.0版。使用下面的简单示例,我假设得到一个错误invalidconversionfromdouble*toconstdouble*#includeusingnamespacestd;voidfoo(constdouble*a){cout为什么编译没有错误?类似的反例如下:#includeusingnamespacestd;voidfoo(constdouble**a){cout(第二个示例的解决方案:将foo定义为foo(constdouble*const*a)。感谢JackEdmonds的评论,这解释了错误消息) 最佳答案

c++ - "invalid comparator": error when overloading the "<" operator

我有一个类需要排序。使用此类的vector,排序时出现“无效比较器”错误。我在我的类中重载了“遵循严格的弱排序。如本post所述.sort需要严格的弱排序。你的comparator不是一个。除其他事项外,对于严格的弱排序,comp(x,x)必须为false。这是我的代码:booloutlierScore::operator这是重载的运算符函数,它所做的本质上是尝试按离群值分数升序排序,核心距离用于打破离群值关系,以及用于打破核心距离关系的ID。StackTrace揭示了这个阶段出现的错误。templateconstexprbool_Debug_lt_pred(_Pr&&_Pred,_T

c++ - enable_if : minimal example for void member function with no arguments

我试图更好地理解C++11中的std::enable_if并且一直在尝试编写一个最小的示例:一个类A带有成员函数voidfoo()根据类模板中的类型T具有不同的实现。下面的代码给出了期望的结果,但我还没有完全理解它。为什么版本V2有效,但V1无效?为什么需要“冗余”类型U?#include#includetemplateclassA{public:A(Tx):a_(x){}//EnablethisfunctionifT==int/*V1*///template::value,int>::type=0>/*V2*/template::value,int>::type=0>voidfoo(