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

Starter Notebook -- AttributeError: module 'heapq' has no attribute '_heappushpop_max' #166

Open
RuanJohn opened this issue Aug 30, 2021 · 2 comments

Comments

@RuanJohn
Copy link

The Reverse Training Starter Notebook runs fine up to 4000 episodes and then gives the following error:

Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/content/joeynmt/joeynmt/__main__.py", line 48, in <module> main() File "/content/joeynmt/joeynmt/__main__.py", line 35, in main train(cfg_file=args.config_path, skip_test=args.skip_test) File "/content/joeynmt/joeynmt/training.py", line 843, in train trainer.train_and_validate(train_data=train_data, valid_data=dev_data) File "/content/joeynmt/joeynmt/training.py", line 494, in train_and_validate valid_duration = self._validate(valid_data, epoch_no) File "/content/joeynmt/joeynmt/training.py", line 626, in _validate self._save_checkpoint(new_best, ckpt_score) File "/content/joeynmt/joeynmt/training.py", line 283, in _save_checkpoint to_delete = heapq._heappushpop_max(self.ckpt_queue, AttributeError: module 'heapq' has no attribute '_heappushpop_max'

@bricksdont
Copy link

Answer with temporary fix here: #162 (comment)

@RuanJohn
Copy link
Author

RuanJohn commented Aug 31, 2021

Thank for the help @bricksdont. It is now working perfectly,

I summary to fix everything:

  • in the starter notebook the line that installs 1.8.0 explicitly should be removed.
  • the following should be cloned ! git clone https://github.com/may-/joeynmt.git instead of ! git clone https://github.com/joeynmt/joeynmt.git

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