Skip to content

UnboundLocalError: local variable 'd_model_save_path' referenced before assignment #9

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
ltl476 opened this issue May 5, 2022 · 2 comments

Comments

@ltl476
Copy link

ltl476 commented May 5, 2022

Training until high epoch...
Epoch 3 / Iteration 0, before phase two:
AUC: 0.464402875861, EER: 0.526548672566, EER_thr: 0.999987721443, F1_score: 0.265179677819
Traceback (most recent call last):
File "train.py", line 25, in
model.train(opt.normal_class)
File "/content/gdrive/MyDrive/OGNet-master/model.py", line 146, in train
fine_tune() #Phase two
File "/content/gdrive/MyDrive/OGNet-master/fine_tune_dicriminator.py", line 24, in fine_tune
model.train(load_model_epoch, model_folder_path)
File "/content/gdrive/MyDrive/OGNet-master/model_fine_tune_discriminator.py", line 116, in train
return d_model_save_path, g_model_save_path
UnboundLocalError: local variable 'd_model_save_path' referenced before assignment

I had this problem while training the Oldisgold model.Could you please help me to slove this? Thank you sincerely and best wishes.

@yty20
Copy link

yty20 commented May 6, 2022

I've run into this problem, too. Find the file where d_model_save_path defined, it is defined inside a if statement, and you need to define it outside the statement or check if it exist when using it.

@ltl476
Copy link
Author

ltl476 commented May 6, 2022

I've run into this problem, too. Find the file where d_model_save_path defined, it is defined inside a if statement, and you need to define it outside the statement or check if it exist when using it.

First, thank you for your help,I 've found the d_model_save_path defined in model.py and model_fine_tune_discriminator.py.Then I defined it outside the if statement,however,it doesn't seem to work.Could you send me your modified py codes please?That'll help me a lot.

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