Model working on Windows but not Linux

I am trying to deploy my flask application using Docker, but before running it in a container, I would like to verify that it works in a linux environment.

After installing all the packages in the right versions (pytorch 1.6, torchtext 0.7.0) as I did in windows, I get the following error for my exported model:

untimeError: Error(s) in loading state_dict for RNN:
        size mismatch for embedding.weight: copying a param with shape torch.Size([101616, 100]) from checkpoint, the shape in current model is torch.Size([100944, 100]).

How can i fix this?

One nn.Embedding layer changed its size and thus the state_dict cannot be loaded.
Check, how the num_embeddings are calculated on your systems and make sure to use the same value (e.g. 101616 from the checkpoint).
Often these errors between Windows and Linux happen, because your code might read/sort/find different files or files in the wrong order etc., as these system calls behave differently on these OSes.