zhongkaifu / Seq2SeqSharp

Seq2SeqSharp is a tensor based fast & flexible deep neural network framework written by .NET (C#). It has many highlighted features, such as automatic differentiation, different network types (Transformer, LSTM, BiLSTM and so on), multi-GPUs supported, cross-platforms (Windows, Linux, x86, x64, ARM), multimodal model for text and images and so on.
Other
200 stars 37 forks source link

SeqLabel model backward compatibility is broken by latest update #76

Closed zsogitbe closed 1 year ago

zsogitbe commented 1 year ago

Description: The last update and the removal of ClsVocabs everywhere (for example, in SeqLabelModel code) is preventing formerly trained models to load. The problem is the target vocabulary which is now not being set by reading ClsVocabs.

Model backward compatibility is extremely important. The models we train nowadays are trained for several days with a lot of resources and time. We cannot afford to loose all of this because the library is improving.

Expected behavior Removing clsVocabs to normalize the code and using tgtVocab everywhere is a good improvement, but this should be done in a way that formerly trained models can still be converted or loaded. Solution: add back the clsVocabs serialization and convert old models automatically or provide a console application to convert old models to the new version.

zhongkaifu commented 1 year ago

Hi @zsogitbe

Here is the way to convert your existing trained model to newer format:

  1. Load the existing trained model by your modified code.
  2. Save the model by calling SaveModel(...) method.

Then you should be able to load the updated model by new code. Let me know if it works.

Thanks Zhongkai Fu

zsogitbe commented 1 year ago

Yes, thank you, I could manage to convert my model (I have also deleted clsVocabs from the model).

I have added this issue for other users who do not know how to modify the code well and need an other long term solution for model backward compatibility.

zsogitbe commented 1 year ago

The code has been updated to support old models automatically.