-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error running gpt2_generate_main.py #147
Comments
Which TF version are you using? To train conditional generation, you'd need a custom mask. |
tensorflow-gpu 1.7.0 So when you say custom mask, is it to selectively mask the loss function corresponding to the segments of input where the model is expected to learn to predict? |
Could you upgrade to Yes. You may want to use the mask function in a forked repo: |
Here is a reference code snippet to mask the loss:
|
Hey, updating TF solved this issue. Thanks for sharing the code snippet for masking! |
I came across a new error after upgrading to TF == 1.12. The _map_tensor_names() in utils/model_utils.py raises the following error when I load a fine-tuned GPT2 checkpoint,
The input argument, original_tensor_name = "transformer_decoder/layer_9/self_attention/multihead_attention/value/kernel" is causing this error.
This problem does not occur when I load the original GPT2 checkpoint. So the saved models of gpt2_train_main.py do not load to gpt2_generate_main.py |
gpt2_generate_main.py updated. Now you can load saved checkpoint by specifying |
When I try to run the gpt2_generate_main.py file, I face the following error,
Also, how to use this model for conditioned text generation tasks? I am working on Reading Comprehension task that takes in a single stream input (Passage + ": " + Question + "? " + Answer) and am using a custom mask to extract loss between the answer start and sequence length indices. Is there a more elegant way to get this done?
Here is the entire list of callbacks:
The text was updated successfully, but these errors were encountered: