faster-rnnlm icon indicating copy to clipboard operation
faster-rnnlm copied to clipboard

big-endian machine

Open earonesty opened this issue 8 years ago • 1 comments

i want to be able to train a model on a linux box, but then ship to an ibm or sun box or any other for execution.

cannot load on a big-endian architecture when it was generated on a little-endian machine

Restoring existing nnet Bad model version: -1834810029

but other than that i can get the program to work fine on ibm/sun

earonesty avatar Jan 22 '16 20:01 earonesty

Well, seems that that you need some more portable format to do this kind of stuff, e.g. text. That's not so hard to force faster-rnnlm to use text format.

  • replace FreadAllOrDie with istream<< in ReadHeader in nnet.cc:19
  • replace fwrite with ostream>> in NNet::Save and NNet::SaveCompatible in nnet.cc:194
  • update Dump and Load functions in util.h:37
  • if you use maxent, you should also update MaxEnt::Dump and MaxEnt::Load in maxent.cc:43

Ok, maybe it's no absolutely trivial, but totally doable ;)

akhti avatar Jan 28 '16 04:01 akhti