Skip to content
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

Run prediction script on TPU #12

Open
ncg-task opened this issue Mar 29, 2021 · 2 comments
Open

Run prediction script on TPU #12

ncg-task opened this issue Mar 29, 2021 · 2 comments

Comments

@ncg-task
Copy link

Dear authors,

When we do the following:

!python run_classifier.py --task_name=semeval --do_train=false --do_eval=false --do_predict=true --data_dir=<data-dir> --vocab_file=$BUCKET_NAME/BERT-large-cased/vocab.txt --bert_config_file=$BUCKET_NAME/BERT-large-cased/bert_config.json --init_checkpoint=$BUCKET_NAME/BERT-large-cased/bert_model.ckpt --max_seq_length=128 --predict_batch_size=16 --max_num_relations=12 --do_lower_case=False --use_tpu=True --tpu_name=<address> --output_dir=$OUTPUT_DIR

the following error is displayed

 File "run_classifier.py", line 424, in convert_single_example
    is_real_example=False)
TypeError: __init__() got an unexpected keyword argument 'is_real_example'

My guess is the fix would need to be applied at Line 424? Then the InputFeatures class (Line 178) initialization would work.

Could you kindly provide the list of arguments we would need to supply in order to enable the function? Or at least some direction to resolve the error to run the prediction script on TPU would be most appreciated.

Thank you very much.

@helloeve
Copy link
Owner

Thank you for your interests on our work! In our work we were not using TPU for experiments, so all the branches that are related to TPU was not updated. My best suggestion to make it work is to make sure PaddingInputExample to accept the same parameters as InputExample, which is what we used for GPU version.

@ncg-task
Copy link
Author

ncg-task commented Apr 1, 2021

Hello, thank you very much for your reply! And thank you for the very relevant advice. May I please ask in which class would we find the implementation for PaddingInputExample so that we can modify it? I will be happy to share the code update in case I manage to get to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants