我是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 ++图像处理库)。我无法追查错误的原因。
提前致谢
答案 0 :(得分:0)
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
例外。