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
Pix2Story: Model won't build - type mismatch when building optimizers. #83
Comments
Hello , I think it could be caused by theano config. Seeing the error you are getting, the problem could be the parameter floatX in theano's config is set as float64 when it should be float32. To check theano's config you can do: import theano print(theano.config) To set a new config for an execution you can do it like this: THEANO_FLAGS='floatX=float32' python training.py More information here: http://deeplearning.net/software/theano/library/config.html If the problem remains the same, could you send a more detailed info about theano's config and the sentences you are passing to the net? Regards |
Hello, |
Can we close this issue? @TomReidNZ did you solve the problem? |
Now I get this error
|
Hello @TomReidNZ , Could you post the whole output you are getting when you execute training.py along some samples of the list of sentences you are passing to the net? Regards |
Hi @ericmcmc, this is the output of the error. We created this text model using these books for the test. |
Hi @TomReidNZ and @gsegares, Seeing the output you get it could be caused by the Theano's version you are using. Could you try updating Theano to 1.0.3 version? Please, let me know if using the original code with Theano 1.0.3 you can train the models. Regards |
Hi @ericmcmc, we changed the NC6 VM that we were using in Azure to use a deep learning template with all the GPU packages included and we are not getting that error anymore. We also changed the conda file to use the specific version of theano. We are having issues with some missing components in the repo (like |
On a new clone of your repo, I can't get the model to train. There's a type mismatch in the updates when building the optimizer.
Running on conda on macOS (using CPU). I didn't mess with any files, just added in the .txt file. I tried updating the n_words, changing various things in the config file but no luck.
Any help would be much appreciated. Thanks, Tom
Error message:
Building optimizers...
Traceback (most recent call last):
File "/anaconda3/envs/storytelling/lib/python3.5/site-packages/theano/compile/pfunc.py", line 193, in rebuild_collect_shared
allow_convert=False)
File "/anaconda3/envs/storytelling/lib/python3.5/site-packages/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 "training.py", line 6, in
EncTrainer.train()
File "/Users/tom/Documents/development/ailab/Pix2Story/source/training/train_encoder.py", line 40, in train
trainer(self.text, self.training_options)
File "/Users/tom/Documents/development/ailab/Pix2Story/source/skipthoughts_vectors/training/train.py", line 128, in trainer
f_grad_shared, f_update = eval(optimizer)(lr, tparams, grads, inps, cost)
File "/Users/tom/Documents/development/ailab/Pix2Story/source/skipthoughts_vectors/encdec_functs/optim.py", line 40, in adam
f_update = theano.function([lr], [], updates=updates, on_unused_input='ignore', profile=False)
File "/anaconda3/envs/storytelling/lib/python3.5/site-packages/theano/compile/function.py", line 317, in function
output_keys=output_keys)
File "/anaconda3/envs/storytelling/lib/python3.5/site-packages/theano/compile/pfunc.py", line 449, in pfunc
no_default_updates=no_default_updates)
File "/anaconda3/envs/storytelling/lib/python3.5/site-packages/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=<TensorType(float32, matrix)>, 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.')
The text was updated successfully, but these errors were encountered: