我是python编程的新手。在python代码中调用函数Vigra.learning.RandomForest.Writehdf5时,会出现如下错误:
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++图像处理库)。我不能追踪错误的原因。
提前感谢
发布于 2013-04-17 02:36:43
Boost.Python错误指示调用方试图使用RandomForest.writeHDF5(str, str, bool)的C++签名,但导出的C++函数需要RandomForest.writeHDF5(str, str)。我不确定overwriteFlag打算做什么行为,但是改变:
self.RF.writeHDF5(fileName, pathInFile, overwriteFlag)至
self.RF.writeHDF5(fileName, pathInFile)应解决Boost.Python.ArgumentError异常。
https://stackoverflow.com/questions/16041778
复制相似问题