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

NameError: name 'trainer' is not defined #61

Open
lvsi-qi opened this issue Apr 18, 2023 · 2 comments
Open

NameError: name 'trainer' is not defined #61

lvsi-qi opened this issue Apr 18, 2023 · 2 comments

Comments

@lvsi-qi
Copy link

lvsi-qi commented Apr 18, 2023

(sd) (stable-diffusion-main) E:\GitHub\stable-diffusion-main>python main.py
Global seed set to 23
Traceback (most recent call last):
File "E:\GitHub\stable-diffusion-main\main.py", line 673, in
model = instantiate_from_config(config.model)
File "E:\GitHub\stable-diffusion-main.venv\lib\site-packages\omegaconf\dictconfig.py", line 353, in getattr
self._format_and_raise(
File "E:\GitHub\stable-diffusion-main.venv\lib\site-packages\omegaconf\base.py", line 190, in _format_and_raise
format_and_raise(
File "E:\GitHub\stable-diffusion-main.venv\lib\site-packages\omegaconf_utils.py", line 821, in format_and_raise
_raise(ex, cause)
File "E:\GitHub\stable-diffusion-main.venv\lib\site-packages\omegaconf_utils.py", line 719, in _raise
raise ex.with_traceback(sys.exc_info()[2]) # set end OC_CAUSE=1 for full backtrace
File "E:\GitHub\stable-diffusion-main.venv\lib\site-packages\omegaconf\dictconfig.py", line 351, in getattr
return self._get_impl(key=key, default_value=DEFAULT_MARKER)
File "E:\GitHub\stable-diffusion-main.venv\lib\site-packages\omegaconf\dictconfig.py", line 438, in _get_impl
node = self._get_node(key=key, throw_on_missing_key=True)
File "E:\GitHub\stable-diffusion-main.venv\lib\site-packages\omegaconf\dictconfig.py", line 470, in _get_node
raise ConfigKeyError(f"Missing key {key}")
omegaconf.errors.ConfigAttributeError: Missing key model
full_key: model
object_type=dict

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\GitHub\stable-diffusion-main\main.py", line 940, in
if trainer.global_rank == 0:
NameError: name 'trainer' is not defined

What should I do?

@megatran
Copy link

Here's my fix for this #65

@sshh12
Copy link

sshh12 commented Jun 26, 2023

Fixed this by using the full config yaml here: https://raw.githubusercontent.com/justinpinkney/stable-diffusion/main/configs/stable-diffusion/pokemon.yaml (rather than copy pasting from readme which was incomplete)

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

3 participants