8000 question about variable 'g_running' · Issue #114 · rosinality/style-based-gan-pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

question about variable 'g_running' #114

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

Open
ForawardStar opened this issue Feb 4, 2021 · 1 comment
Open

question about variable 'g_running' #114

ForawardStar opened this issue Feb 4, 2021 · 1 comment

Comments

@ForawardStar
Copy link
ForawardStar commented Feb 4, 2021

Hi , what a wonderful project! I successfully run it on my computer! I just wonder why the following code in Line 106, train.py does not raise any error like "there is no deifnition of variable 'g_running'":
torch.save( { 'generator': generator.module.state_dict(), 'discriminator': discriminator.module.state_dict(), 'g_optimizer': g_optimizer.state_dict(), 'd_optimizer': d_optimizer.state_dict(), 'g_running': g_running.state_dict(), }, f'checkpoint/train_step-{ckpt_step}.model', )

I found the defination of variable 'g_running' only exists in "if name == 'main': ", while the arguments to the funtion "train()" in train.py do not contain "g_running", and there is no definition about variable "g_running" in the funtion "train()". I do not understand why it does not raise any error. Thanks

@rosinality
Copy link
Owner

Because you will use train() inside of if __name__ == '__main__'. Anyway it would be better to use it as an explicit parameters.

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
0