rikdz / GraphWriter

Code for "Text Generation from Knowledge Graphs with Graph Transformers"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generator.py size mismatch

m0wacker opened this issue · comments

Hello,

I am having trouble running the the generator.py.

I ran the testing via "python ./train.py -save trained_weights -t1size 4 -t2size 4 -t3size 2 -title". I had to reduce the batch size this much because my laptop GPU only has 4 GB RAM and my Desktop-PC does not have a Nvidia GPU.
Because of the weak GPU I also reduced the training dataset to just 10k lines instead of the original 40k, because the original size took well above 5 days to train. I am aware this might achieve worse results, but that does not matter to me.

This are the only two things (batch-size and training-data-size) I changed. When running the generator.py via "python generator.py -save=trained_weights/19.vloss-4.637616.lr-0.1" I get size mismatch errors:

size mismatch for lstm.weight_ih: copying a param with shape torch.Size([2000, 1500]) from checkpoint, the shape in current model is torch.Size([2000, 1000]).
size mismatch for out.weight: copying a param with shape torch.Size([6318, 1500]) from checkpoint, the shape in current model is torch.Size([6318, 1000]).
size mismatch for switch.weight: copying a param with shape torch.Size([1, 1500]) from checkpoint, the shape in current model is torch.Size([1, 1000]).
size mismatch for mattn.attnlin.weight: copying a param with shape torch.Size([500, 1500]) from checkpoint, the shape in current model is torch.Size([500, 1000]).

This error was already stated in other issues like https://github.com/rikdz/GraphWriter/issues/20 for example, but I cloned the repo just a few days ago so I definetely have the newest version.

Does anyone know why this error occurs and how I can fix it? Thanks!