Fairseq: Stories model checkpoint has hardcoded paths saved in it.

Created on 18 Jan 2019  路  8Comments  路  Source: pytorch/fairseq

I downloaded the stories model from stories_checkpoint.tar.bz2. Following the instruction from the main README, I attempted to run generate.py, but it crashes with:

OSError: Model file not found: /checkpoint/angelafan/wp_open_source/checkpoint_best.pt

This is because when the model is loaded, the args extracted from the state dictionary include an existing, hardcoded path to a pertained model that it then tries to load. This seems like a fairly poor design that needs addressing, though do correct me if I am missing something.

Most helpful comment

as an aside, I want to say that while I agree the code could be improved, I am glad I released it anyway so others can reproduce the model, needing to modify the path for the pretrained model and all.

All 8 comments

I was able to load the checkpoint and change the args to point to the location of the pertained checkpoint that came with the download. But now I'm just getting massive amounts of GPU asset failures. Has anyone successfully downloaded and used the story models to generate stories?

See: https://github.com/pytorch/fairseq/tree/master/examples/stories , you must pass an override argument to detail where the pretrained model is located.

yes, others have been able to use the story models to generate stories, some with improved results. It would be better if you detailed the GPU assert failures.

if you would like to help improve the codebase, please submit a pull request!

as an aside, I want to say that while I agree the code could be improved, I am glad I released it anyway so others can reproduce the model, needing to modify the path for the pretrained model and all.

I wonder if we should manually change the pretrained checkpoint path in the pth file to: /please/see/examples/stories/README 馃槃

For more information, I ran this:
python generate.py data-bin/writingPrompts --path data-bin/models/fusion_checkpoint.pt --batch-size 32 --beam 1 --sampling --sampling-topk 10 --sampling-temperature 0.8 --nbest 1 --model-overrides "{'pretrained_checkpoint':'data-bin/models/pretrained_checkpoint.pt'}"

I cloned commit: b15f5f5. I see that there may be a new commit addressing this, so I will attempt to clone that commit and try again.

as an aside, I want to say that while I agree the code could be improved, I am glad I released it anyway so others can reproduce the model, needing to modify the path for the pretrained model and all.

I agree with you completely. I greatly appreciate your releasing the code and if what I was saying came across poorly, I apologize.

I wonder if we should manually change the pretrained checkpoint path in the pth file to: /please/see/examples/stories/README 馃槃

Ha. I did look at that and just completely missed the override command. My bad.

I think cloning the latest commit did the trick. That, or walking through the process again from the start.

Was this page helpful?
0 / 5 - 0 ratings