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

Unable to change the max_length of captions to train for another dataset #74

Open
preetskhalsa97 opened this issue Jul 11, 2018 · 1 comment

Comments

@preetskhalsa97
Copy link

Hey!
I am trying to train the model on another dataset which has relatively longer captions. When I changed max_length = 100 (earlier 15) in main function of prepro.py, it gives the following error:
File "train.py", line 25, in
main()
File "train.py", line 22, in main
solver.train()
File "/home/ubuntu/psk/show-attend-tell/show-attend-and-tell-tensorflow/core/solver.py", line 138, in train
_, l = sess.run([train_op, loss], feed_dict)
File "/home/ubuntu/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/home/ubuntu/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1111, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (128, 102) for Tensor u'Placeholder_1:0', which has shape '(?, 17)'

Can you please help me navigate through it?
TIA! :)

@zBabar
Copy link

zBabar commented Aug 28, 2018

I think "max_length" is the only variable to change in prepro.py..... When u get your features successfully... then u run train.py.... now in train.py change parameter "n_time_steps" = new_max_len(in your case 100)+1... and in solver.py you also need to change 3 to 4 parameters. because previously its been hardcoded as per 15

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