alex-berard / seq2seq

Attention-based sequence to sequence learning
Apache License 2.0
388 stars 122 forks source link

get error when using pretrained model #18

Closed chongyang-xu closed 6 years ago

chongyang-xu commented 6 years ago

Hi,I want to use your pretrained model from the following link but I get an error. Could you help me figure out this? https://drive.google.com/file/d/1XM_76xP5kg8--BvykF3uJdCSYtdLFGX_/view?usp=sharing

I use tensorflow 1.6,Python 3.6.4 with Anaconda on Ubuntu 14.04

run command
./seq2seq.sh models/WMT14/config.yaml --decode -v and part of the error message

Traceback (most recent call last): File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1361, in _do_call return fn(*args) File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1340, in _run_fn target_list, status, run_metadata) File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [500,30000] rhs shape= [620,30000] [[Node: save_1/Assign_14 = Assign[T=DT_FLOAT, _class=["loc:@decoder_fr/softmax1/kernel"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder_fr/softmax1/kernel, save_1/RestoreV2/_15)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/xuchongyang/inference_evaluation/workloads/code/seq2seq/translate/main.py", line 306, in main() File "/home/xuchongyang/inference_evaluation/workloads/code/seq2seq/translate/main.py", line 278, in main model.initialize([best_checkpoint], params) File "/home/xuchongyang/inference_evaluation/workloads/code/seq2seq/translate/translation_model.py", line 720, in initialize load_checkpoint(sess, None, checkpoint, blacklist=blacklist, whitelist=whitelist, params) File "/home/xuchongyang/inference_evaluation/workloads/code/seq2seq/translate/translation_model.py", line 796, in load_checkpoint tf.train.Saver(variables).restore(sess, filename) File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1755, in restore {self.saver_def.filename_tensor_name: save_path}) File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 905, in run run_metadata_ptr) File "/home/xuchongyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1137, in _run feed_dict_tensor, options, run_metadata)