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

Can you provide details on you configuration (theano version especially) #3

Closed
tdeboissiere opened this issue Jun 13, 2018 · 3 comments
Labels

Comments

@tdeboissiere
Copy link

tdeboissiere commented Jun 13, 2018

I have tried running your code but got the following error message (MNIST experiments):

theano.gof.fg.MissingInputError: A variable that is an input to the graph was neither provided as an input to the function nor given a value. A chain of variables leading from this input to an output is [x, dot.0, Elemwise{add,no_inplace}.0, Elemwise{add,no_inplace}.0, Elemwise{add,no_inplace}.0, h1, dot.0, Elemwise{add,no_inplace}.0, Elemwise{add,no_inplace}.0, h2, dot.0, logp, Elemwise{mul,no_inplace}.0, Elemwise{exp,no_inplace}.0, Elemwise{mul,no_inplace}.0, Sum{axis=[0], acc_dtype=float64}.0, mean]. This chain may not be unique
Backtrace when the variable is created:
  File "run_experiments.py", line 245, in <module>
    main()
  File "run_experiments.py", line 241, in main
    methods[name]()
  File "run_experiments.py", line 184, in run_experiments_mnist
    ex.train_maf_cond([n_hiddens]*2, act_fun, n_layers*i, mode)
  File "/u/home/maf/experiments.py", line 248, in train_maf_cond
    model = mafs.ConditionalMaskedAutoregressiveFlow(data.n_labels, data.n_dims, n_hiddens, act_fun, n_mades, mode=mode)
  File "/u/home/maf/ml/models/mafs.py", line 172, in __init__
    self.input = tt.matrix('x', dtype=dtype) if input is None else input

It looks like the model is not getting the data properly. Could this be caused by changes in theano version ?

@gpapamak
Copy link
Owner

That's odd. I've never encountered this issue.

When I originally run the experiments, I used Theano v0.9.0.

I tried to reproduce the error with Theano v0.9.0 and Theano v1.0.2 (latest version), but I couldn't. The code seems to run fine as is.

My understanding is that you're issuing

python run_experiments.py mnist

and then the error happens when Conditional MAF is to be trained. When a model is being trained, the code displays training info on screen, something like:

Epoch = 1, train loss = 839.124948406, validation loss = 1755.41093458
Epoch = 2, train loss = 709.554258655, validation loss = 1751.73216701
...

Can you provide more details on when exactly you encounter the error? What does the code output up to the point the error happens? Are the other models (MADE, MADE MoG, RealNVP, and their conditional versions) trained successfully?

@blues-lin
Copy link

@tdeboissiere Sorry to use this discuss on another question.

I want to train a mafs.ConditionalMaskedAutoregressiveFlow, but the model loss always go to negative.

It starts at like 58.7, but after few steps(about 800) it goes negative.
something like: Epoch 3 - Step 221102 - loss -426.319 - lr 1.67e-05 - 0.32 s/step

Does this normal for maf loss go to negative? because the determine Jacoian term?
If this is not normal, any suggestions I can debug this? lack or too much of params to learn? need more regularization?

I am using tensorflow code which adapt Theano to Tensorflow: https://github.com/spinaotey/maf_tf

@gpapamak
Copy link
Owner

This is totally normal. Log-likelihood loss doesn't have to be positive, its lowest value can be negative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants