-
Notifications
You must be signed in to change notification settings - Fork 2k
InvalidArgumentError: Mismatch between Graphs #415
Comments
I'm getting the same error with a similar setup, I'm using tensorflow 1.12. Did you ever figure out a solution? |
I'm getting the same error with a similar setup, I'm using tensorflow-night. Did you ever figure out a solution? |
I found the problem, although I'm not sure how exactly to solve it. I know it's not a solution, but I added the following lines in line 503 in nmt/nmt.py and I was able to run the model: I guess the problem is in the script nmt/scripts/wmt16_en_de.sh where wmt16/vocab.bpe.32000 is being created. |
I end up just traing my own GNMT model. Afterwards, you can run the inference code with your own model without issue. I suspect the vocab file generation code for the pretrained model is somehow different. |
I used the same solution as christ1ne. It seems the generation of the vocab file is either non-deterministic, or has changed since the model was pretrained. If we were able to find a copy of the vocab file which was used to train the models then it would work. Unfortunately I had no look tracking one down. |
I got the same problem when tried to export inference graph with tensorflow object detection API, but i have solved it. I has mistaken with choose of pipeline.config file to export. In my case, it should be exactly the same with pipeline.config file that was used to train model. |
@BenTaylor3115 Using the BPE file linked in issue #85, I ran the BPE portion and it generated 37008 lines. |
I got the same problem. how to solve it. |
I had the same problem with the provided model: http://download.tensorflow.org/models/nmt/10122017/ende_gnmt_model_8_layer.zip
I suspect that the bpe algorithm has changed and the script extracts different wordpieces compared to late 2017. As a fix, could you provide a vocabulary for the trained models? I simply cannot train my own, because I don't have enough GPU :( |
FYI I rolled back the |
If you are looking for a trained model, please feel free to see if the following link works for you: https://github.com/mlperf/inference/tree/master/cloud/translation/gnmt/tensorflow |
thanks @christ1ne but that has the same problem than the one I tried: without the vocabulary the models are useless. |
@gaebor the vocab generation is here: download_dataset.sh at https://github.com/mlperf/training/tree/master/rnn_translator |
I'd be damned if I haven't tried it, see: #415 (comment) |
The vocab generation scripts are different at MLPerf and at the TF nmt repo. |
I beg to differ: https://github.com/mlperf/training/blob/master/rnn_translator/download_dataset.sh#L147 |
I have tried the README exactly for English to German 8 layer inference with the current setup
Ubuntu 16.04
Tensorflow 1.9
but I receive the following error:
InvalidArgumentError (see above for traceback): Restoring from checkpoint
failed. This is most likely due to a mismatch between the current graph and
the graph from the checkpoint. Please ensure that you have not altered the
graph expected based on the checkpoint. Original error:
Assign requires shapes of both tensors to match. lhs shape= [36549,1024] rhs
shape= [36548,1024]
[[Node: save/Assign_26 = Assign[T=DT_FLOAT, _class=
["loc:@embeddings/encoder/embedding_encoder"], use_locking=true,
validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"]
(embeddings/encoder/embedding_encoder, save/RestoreV2:26)]]
Can someone advise me on how to resolve the issue?
The text was updated successfully, but these errors were encountered: