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 #81

Open
sourabhdeoghare opened this issue Jul 4, 2019 · 0 comments
Open

TypeError #81

sourabhdeoghare opened this issue Jul 4, 2019 · 0 comments

Comments

@sourabhdeoghare
Copy link

Loading data
Building model
Building sampler
Building f_init...
Done
Building f_next..
Done
Building f_log_probs...
Done
Building f_cost...
Done
Computing gradient...
Done
Building optimizers...
Traceback (most recent call last):
File "/home/sourabh/anaconda3/lib/python3.6/site-packages/Theano-1.0.4-py3.6.egg/theano/compile/pfunc.py", line 193, in rebuild_collect_shared
allow_convert=False)
File "/home/sourabh/anaconda3/lib/python3.6/site-packages/Theano-1.0.4-py3.6.egg/theano/tensor/type.py", line 234, in filter_variable
self=self))
TypeError: Cannot convert Type TensorType(float64, matrix) (of Variable Elemwise{add,no_inplace}.0) into Type TensorType(float32, matrix). You can try to manually convert Elemwise{add,no_inplace}.0 into a TensorType(float32, matrix).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_nmt.py", line 44, in
'reload': [False]})
File "train_nmt.py", line 31, in main
overwrite=False)
File "/home/sourabh/codes/dl4mt-tutorial-master/session1/nmt.py", line 975, in train
f_grad_shared, f_update = eval(optimizer)(lr, tparams, grads, inps, cost)
File "/home/sourabh/codes/dl4mt-tutorial-master/session1/nmt.py", line 773, in adam
on_unused_input='ignore', profile=profile)
File "/home/sourabh/anaconda3/lib/python3.6/site-packages/Theano-1.0.4-py3.6.egg/theano/compile/function.py", line 317, in function
output_keys=output_keys)
File "/home/sourabh/anaconda3/lib/python3.6/site-packages/Theano-1.0.4-py3.6.egg/theano/compile/pfunc.py", line 449, in pfunc
no_default_updates=no_default_updates)
File "/home/sourabh/anaconda3/lib/python3.6/site-packages/Theano-1.0.4-py3.6.egg/theano/compile/pfunc.py", line 208, in rebuild_collect_shared
raise TypeError(err_msg, err_sug)
TypeError: ('An update must have the same type as the original shared variable (shared_var=Wemb_mean, shared_var.type=TensorType(float32, matrix), update_val=Elemwise{add,no_inplace}.0, update_val.type=TensorType(float64, matrix)).', 'If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.')

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