GithubHelp home page GithubHelp logo

Comments (4)

yanwii avatar yanwii commented on August 17, 2024

maximum_iterations = tf.round(tf.reduce_max(self.encoder_inputs_length) * 10)

默认问答最大长度差在10倍以内,你可以将10调大

from dynamic-seq2seq.

SkylerHuang avatar SkylerHuang commented on August 17, 2024

@yanwii
谢谢,在关闭问题中已经发现问题所在了

from dynamic-seq2seq.

xiaoming0217 avatar xiaoming0217 commented on August 17, 2024

@yanwii
你好 我用自己的数据训练模型 也出现这个问题,问题描述如下:
InvalidArgumentError (see above for traceback): logits and labels must have the same first dimension, got logits shape [240,1516] and labels shape [260]
[[Node: sequence_loss/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](sequence_loss/Reshape, sequence_loss/Reshape_1/_509)]]

我修改了这个参数 (原来是20),比如30,还是报改错误,请问是什么原因呢,非常感谢。

from dynamic-seq2seq.

yanwii avatar yanwii commented on August 17, 2024

因为decoder是支持变长的,但这个长度需要我们手动指定
maximum_iterations = tf.round(tf.reduce_max(self.encoder_inputs_length) * 10)
可以看到最大迭代次数是encoder最大长度的10倍, 说明你的decoder输出比encoder最大长度的10(30)倍还要打,这就造成了在计算loss的时候不能对齐,解决方法就是调大点,或者控制decoder的长度,当然也可以在计算loss的时候进行对齐操作。

from dynamic-seq2seq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.