Shark-ML / Shark

The Shark Machine Leaning Library. See more:
http://shark-ml.github.io/Shark/
GNU Lesser General Public License v3.0
493 stars 130 forks source link

Serialization #267

Open FoxMarts opened 5 years ago

FoxMarts commented 5 years ago

Hello, I'm trying to save the model created in the RFTutorial using the example of the tutorial serialization, but an error appears in make.

error: ‘polymorphic_text_oarchive’ is not a member of ‘boost::archive’ boost::archive::polymorphic_text_oarchive oa(ofs);

Can you help me solve it?thanks

Andurian commented 5 years ago

There seems to be a problem with certain boost versions (according to Core/ISerializable.h between 1.56 and 1.58) where you have to use boost::archive::text_oarchive instead of boost::archive::polymorphic_text_oarchive.

You can (and maybe should) use shark::TextOutArchive and shark::TextInArchive which automatically typedefs to the correct version.