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

TypeError:unbound method <lambda>() must be called with o instance as first argument (got Tensor instance instead) #10

Closed
MrCPlusPlus opened this issue Jul 13, 2018 · 1 comment

Comments

@MrCPlusPlus
Copy link

When I ran this code, I got the error listed as below.

mpiexec -n 1 --allow-run-as-root python train.py --problem celeba --image_size 256 --n_level 6 --depth 32 --flow_permutation 2 --flow_coupling 0 --seed 0 --learntop --lr 0.001 --n_bits_x 5
/usr/local/lib/python2.7/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as register_converters
Rank 0 Batch sizes Train 1 Test 1 Init 4
(3000, 1, 1)
Train epoch size: 49984
('Creating pad', '1_1
[130, 130]')
Traceback (most recent call last):
File "train.py", line 386, in
main(hps)
File "train.py", line 162, in main
model = model.model(sess, hps, train_iterator, test_iterator, data_init)
File "/data/home/ervinchen/share/glow-master/model.py", line 238, in model
test_iterator, data_init, lr, f_loss)
File "/data/home/ervinchen/share/glow-master/model.py", line 25, in abstract_model_xy
loss_train, stats_train = f_loss(train_iterator, True)
File "/data/home/ervinchen/share/glow-master/model.py", line 226, in f_loss
bits_x, bits_y, pred_loss = _f_loss(x, y, is_training, reuse)
File "/data/home/ervinchen/share/glow-master/model.py", line 171, in _f_loss
z, objective = encoder(z, objective)
File "/data/home/ervinchen/share/glow-master/model.py", line 89, in encoder
z, objective = split2d("pool"+str(i), z, objective=objective)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 183, in func_with_args
return func(*args, **current_args)
File "/data/home/ervinchen/share/glow-master/model.py", line 486, in split2d
objective += pz.logp(z2)
TypeError: unbound method () must be called with o instance as first argument (got Tensor instance instead)

@MrCPlusPlus
Copy link
Author

The problem seems to be solved by changing python2 to python3...

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

1 participant