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

VAE_Cartoon_Tensorflow Training #822

Open
ReidTPowell opened this issue May 21, 2023 · 4 comments
Open

VAE_Cartoon_Tensorflow Training #822

ReidTPowell opened this issue May 21, 2023 · 4 comments

Comments

@ReidTPowell
Copy link

training VAE fails with the following error:

UnboundLocalError: local variable 'kl_loss' referenced before assignment

Any thoughts or suggestion on how to resolve this error would be greatly appreciated.

@RohitDhankar
Copy link

Apparently the loss variable is being accessed in code before it's getting initialised

@ReidTPowell
Copy link
Author

ReidTPowell commented May 22, 2023 via email

@RohitDhankar
Copy link

Please do correct me if im wrong ... i may end up confusing you then providing a solution

Presuming you are using this code -- VAE_Cartoon_TensorFlow.ipynb

Where are you getting this bit of code ...probably from a TEMP FILE of KERAS or TF.Autograph origin thats letting us know that the Notebook cells you have run have missed a continuous Kernel run ...
So while it needs that variable value -- kl_loss , its not getting that within the -- Autograph Code -- https://www.tensorflow.org/api_docs/python/tf/autograph

File ~\AppData\Local\Temp\__autograph_generated_filem_niztwx.py:11, in outer_factory.<locals>.inner_factory.<locals>.tf__vae_loss(y_true, y_pred, mean, var) 9 retval_ = ag__.UndefinedReturnValue() 10 r_loss = ag__.converted_call(ag__.ld(mse_loss), (ag__.ld(y_true), ag__.ld(y_pred)), None, fscope) ---> 11 kl_loss = ag__.converted_call(ag__.ld(kl_loss), (ag__.ld(mean), ag__.ld(log_var)), None, fscope)

@ReidTPowell
Copy link
Author

ReidTPowell commented May 23, 2023 via email

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