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

AttributeError: 'Trainer' object has no attribute 'is_world_master' while fine tuning BioBERT-PyTorch on my custom data set #7

Closed
abhibisht89 opened this issue Dec 17, 2020 · 5 comments

Comments

@abhibisht89
Copy link

Environment info:
transformers version: 4.0.0
Platform: Linux-4.15.0-96-generic-x86_64-with-debian-buster-sid
Python version: 3.7.8
PyTorch version (GPU?): 1.7.0 (True)

while running run_ner.py , getting above error at below line:
if trainer.is_world_master():
tokenizer.save_pretrained(training_args.output_dir)

@ankan94
Copy link

ankan94 commented Jan 6, 2021

Have you resolved this?
I'm getting the same error at this level. The is_world_master has probably been changed to is_world_process_zero. You can give it a try.

@abhibisht89
Copy link
Author

@ankan94 yeah , I did the same thing replace "is_world_master" by "is_world_process_zero" in the code and it is working as expected for me

@abhibisht89
Copy link
Author

found a work around as mention above

@wzkariampuzha
Copy link

wzkariampuzha commented Aug 18, 2021

Please fix this in the run_ner code @dmis-lab

@rkatriel
Copy link

rkatriel commented Aug 22, 2023

This issue is still present in the current GitHub version. I followed the directions on the main web page (https://github.com/dmis-lab/biobert-pytorch) and got the same error:

Traceback (most recent call last):
File "/Users/ron/Documents/GitHub/biobert-pytorch-master/named-entity-recognition/run_ner.py", line 328, in
main()
File "/Users/ron/Documents/GitHub/biobert-pytorch-master/named-entity-recognition/run_ner.py", line 249, in main
if trainer.is_world_master():
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Trainer' object has no attribute 'is_world_master'

Replacing "is_world_master" by "is_world_process_zero", as suggested above, makes the error go away but it should be fixed at the source in Git.

In case it matters, this is on an MacBook Air (M2, 2022) with macOS 12.6 (Monterey).

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

4 participants