-
Notifications
You must be signed in to change notification settings - Fork 723
KeyError: 'best_loss' - local API test #401
Description
🐛 Bug
I'm trying to run metaseq-api-local with the 2.7B model but it fails starting with the error KeyError: 'best_loss'
To Reproduce
- Run metaseq-api-local
Error:
Traceback (most recent call last):
File "/opt/conda/bin/metaseq-api-local", line 8, in
sys.exit(cli_main())
File "/mnt/metaseq/metaseq_cli/interactive_hosted.py", line 370, in cli_main
distributed_utils.call_main(cfg, worker_main, namespace_args=args)
File "/mnt/metaseq/metaseq/distributed/utils.py", line 279, in call_main
return main(cfg, **kwargs)
File "/mnt/metaseq/metaseq_cli/interactive_hosted.py", line 176, in worker_main
models = generator.load_model() # noqa: F841
File "/mnt/metaseq/metaseq/hub_utils.py", line 564, in load_model
models, _model_args, _task = _load_checkpoint()
File "/mnt/metaseq/metaseq/hub_utils.py", line 547, in _load_checkpoint
return checkpoint_utils.load_model_ensemble_and_task(
File "/mnt/metaseq/metaseq/checkpoint_utils.py", line 450, in load_model_ensemble_and_task
state = load_checkpoint_to_cpu(filename, arg_overrides)
File "/mnt/metaseq/metaseq/checkpoint_utils.py", line 417, in load_checkpoint_to_cpu
state = _upgrade_state_dict(state)
File "/mnt/metaseq/metaseq/checkpoint_utils.py", line 558, in _upgrade_state_dict
{"criterion_name": "CrossEntropyCriterion", "best_loss": state["best_loss"]}
KeyError: 'best_loss'
Code sample
Just the repo
Expected behavior
run
Environment
- metaseq Version (e.g., 1.0 or master): fresh clone
- PyTorch Version (e.g., 1.0) 1.10
- OS (e.g., Linux, Windows, MacOS): Ubuntu 20.04
- How you installed metaseq (
pip, source): per the setup instructions - Build command you used (if compiling from source): same
- Python version: 3.8.13
- CUDA/cuDNN version: 11.3
- GPU models and configuration: RTX A2000 12GB
- Any other relevant information: