首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RandomForest.Writehdf5给出boost.python参数不匹配错误

RandomForest.Writehdf5给出boost.python参数不匹配错误
EN

Stack Overflow用户
提问于 2013-04-17 00:03:00
回答 1查看 81关注 0票数 0

我是python编程的新手。在python代码中调用函数Vigra.learning.RandomForest.Writehdf5时,会出现如下错误:

代码语言:javascript
复制
self.RF.writeHDF5(fileName, pathInFile, overwriteFlag)
Boost.Python.ArgumentError: Python argument types in
RandomForest.writeHDF5(RandomForest, str, str, bool)
did not match C++ signature:
writeHDF5(class vigra::RandomForest<unsigned int,struct vigra::ClassificationTag>,          class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >   filename, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > pathInFile='')

我已经安装了python扩展包vigranumpy以及boost python,但是我还没有安装vigra (c++图像处理库)。我不能追踪错误的原因。

提前感谢

EN

回答 1

Stack Overflow用户

发布于 2013-04-17 02:36:43

Boost.Python错误指示调用方试图使用RandomForest.writeHDF5(str, str, bool)的C++签名,但导出的C++函数需要RandomForest.writeHDF5(str, str)。我不确定overwriteFlag打算做什么行为,但是改变:

代码语言:javascript
复制
self.RF.writeHDF5(fileName, pathInFile, overwriteFlag)

代码语言:javascript
复制
self.RF.writeHDF5(fileName, pathInFile)

应解决Boost.Python.ArgumentError异常。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16041778

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档