Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Running opt-baselines requires os.environ["USER"] #83

Open
Leli1024 opened this issue May 10, 2022 · 3 comments
Open

Running opt-baselines requires os.environ["USER"] #83

Leli1024 opened this issue May 10, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Leli1024
Copy link

🐛 Bug

When I'm trying to load the model in some way, I keep getting an error that the USER environment variable is missing, I have attempted to fix this by overriding the variable manually, however I still get an error raise RuntimeError("Where are you running this?! Check DATA_LOCATIONS.") RuntimeError: Where are you running this?! Check DATA_LOCATIONS.

To Reproduce

Steps to reproduce the behavior (always include the command you ran):

  1. Run opt-baselines -n 2 -g 8 -p test_v0 --model-size 1.3b --azure --checkpoints-dir "model_ckpts" --no-save-dir # Remove this if you want to print out full save-dir path
  2. See error Traceback (most recent call last): File "/home/studio-lab-user/.conda/envs/studiolab/bin/opt-baselines", line 33, in <module> sys.exit(load_entry_point('metaseq', 'console_scripts', 'opt-baselines')()) File "/home/studio-lab-user/metaseq/metaseq/launcher/opt_baselines.py", line 313, in cli_main sweep_main( File "/home/studio-lab-user/metaseq/metaseq/launcher/sweep.py", line 374, in main args = _get_args(add_extra_options_func, scheduler_args) File "/home/studio-lab-user/metaseq/metaseq/launcher/sweep.py", line 238, in _get_args _modify_arg_defaults_based_on_env(env, args) File "/home/studio-lab-user/metaseq/metaseq/launcher/sweep.py", line 263, in _modify_arg_defaults_based_on_env os.environ["USER"], File "/home/studio-lab-user/.conda/envs/studiolab/lib/python3.9/os.py", line 679, in __getitem__ raise KeyError(key) from None KeyError: 'USER'

Environment

  • python and torch: as specified within the setup readme
  • OS (e.g., Linux, Windows, MacOS): linux (AWS instance)
  • How you installed metaseq (pip, source): source
@Leli1024 Leli1024 added the bug Something isn't working label May 10, 2022
@stephenroller
Copy link
Contributor

Guess we need to change that to os.getuser()?

@Leli1024
Copy link
Author

I tried this but apparently it gives a function doesn't exist error, I'm assuming it's a Linux specific issue maybe?

@stephenroller
Copy link
Contributor

https://stackoverflow.com/a/842096 my memory was slightly off

@suchenzang suchenzang changed the title Loading the model or training in any way gives an environment variable error Running opt-baselines gives an environment variable error May 12, 2022
@suchenzang suchenzang changed the title Running opt-baselines gives an environment variable error Running opt-baselines requires os.environ["USER"] May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants