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

eval bug #11

Closed
Johnson-yue opened this issue Apr 29, 2020 · 6 comments
Closed

eval bug #11

Johnson-yue opened this issue Apr 29, 2020 · 6 comments

Comments

@Johnson-yue
Copy link

when compute FID and LPIPS , mode = "latent" then ,the bug
UnBoundLocalError: local variable 'loader_ref' referenced before assigment

@yunjey
Copy link
Collaborator

yunjey commented Apr 30, 2020

@Johnson-yue Could you report the full error message?

@iPsych
Copy link

iPsych commented May 8, 2020

@yunjey
I faced same error. Following the train pipeline in Readme.md, with custom 4 domains data.

Calculating evaluation metrics...
Number of domains: 4
Preparing DataLoader for the evaluation phase...
Traceback (most recent call last):
  File "main.py", line 182, in <module>
    main(args)
  File "main.py", line 59, in main
    solver.train(loaders)
  File "/home/ipsych/ML/Stargan_v2/core/solver.py", line 170, in train
    calculate_metrics(nets_ema, args, i+1, mode='latent')
  File "/home/ipsych/.conda/envs/Pytorch_1_4_0/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad
    return func(*args, **kwargs)
  File "/home/ipsych/ML/Stargan_v2/metrics/eval.py", line 61, in calculate_metrics
    iter_ref = iter(loader_ref)
UnboundLocalError: local variable 'loader_ref' referenced before assignment

@iPsych
Copy link

iPsych commented May 9, 2020

It seems that in solver.py line 170,
calculate_metrics(nets_ema, args, i+1, mode='latent')
calls undefined loader_ref in eval.py.

@Johnson-yue
Copy link
Author

@iPsych yes, when I train custom dataset, the num_domain is not 3 , and it report this error

@iPsych
Copy link

iPsych commented May 9, 2020

@Johnson-yue Interestingly, I trained 7 domains successfully once, and now, training 4 domains model, and same error happens.

@yunjey
Copy link
Collaborator

yunjey commented Jul 17, 2020

Closing the issue, thinking that the question was answered.
Please reopen the issue as needed :)

@yunjey yunjey closed this as completed Jul 17, 2020
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