-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #343
Comments
Did you try with pytorch lightning==1.6.1? The problem arised for me when my pytorch lightning is 1.7.0 and above |
The actual issue isn't with For me it was |
my pytorch_lightning==1.4.2,and I try with pytorch lightning==1.6.1 ,however it didn't work |
How fix it? It confuse me a lot. |
Traceback (most recent call last):
File "/root/autodl-tmp/LDM/main.py", line 535, in
model = instantiate_from_config(config.model)
File "/root/miniconda3/envs/ldm/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 353, in getattr
self._format_and_raise(
File "/root/miniconda3/envs/ldm/lib/python3.8/site-packages/omegaconf/base.py", line 190, in _format_and_raise
format_and_raise(
File "/root/miniconda3/envs/ldm/lib/python3.8/site-packages/omegaconf/_utils.py", line 821, in format_and_raise
_raise(ex, cause)
File "/root/miniconda3/envs/ldm/lib/python3.8/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 "/root/miniconda3/envs/ldm/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 351, in getattr
return self._get_impl(key=key, default_value=DEFAULT_MARKER)
File "/root/miniconda3/envs/ldm/lib/python3.8/site-packages/omegaconf/dictconfig.py", line 438, in _get_impl
node = self._get_node(key=key, throw_on_missing_key=True)
File "/root/miniconda3/envs/ldm/lib/python3.8/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 "/root/autodl-tmp/LDM/main.py", line 740, in
if trainer.global_rank == 0:
NameError: name 'trainer' is not defined
how can I sovle this problem?
The text was updated successfully, but these errors were encountered: