Tensorflow bytenet张量形状不匹配错误

时间:2017-01-09 21:24:09

标签: python tensorflow

我正在尝试使用此链接中提供的法语 - 英语翻译实现。

https://github.com/buriburisuri/ByteNet

当我在其中运行train.py文件时,出现以下错误。

Traceback (most recent call last):
  File "C:\Users\516228\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\client\session.py", line 1021, in _do_call
    return fn(*args)
  File "C:\Users\516228\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\client\session.py", line 1003, in _run_fn
    status, run_metadata)
  File "C:\Users\516228\AppData\Local\Programs\Python\Python35\lib\contextlib.py", line 66, in __exit__
    next(self.gen)
  File "C:\Users\516228\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
    pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [122,20] rhs shape= [122,40]
     [[Node: save/Assign = Assign[T=DT_FLOAT, _class=["loc:@emb_x"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/cpu:0"](emb_x, save/RestoreV2)]]    

它的要点似乎是形状不匹配错误。我在restore=False中尝试了tf.train选项,但无济于事。任何人都可以帮我解决这个问题吗?如果我能以某种方式解决这个错误,我会完成的。非常感谢提前!

0 个答案:

没有答案