“ ValueError:两个形状中的尺寸0必须相等,但对于输入形状为[40000,100],[158,100]的'Assign_1'(op:'Assign')而言,其值应为40000和158。

时间:2019-02-26 22:54:54

标签: python-2.7 tensorflow

我正在尝试按原样运行ECM代码。 作者声称可以正确运行代码。但是当我尝试运行它时,会出现此错误。 标志变量如下: tf.app.flags.DEFINE_float("learning_rate", 0.5, "Learning rate.") tf.app.flags.DEFINE_float("learning_rate_decay_factor", 0.99,"Learning rate decays by this much.") tf.app.flags.DEFINE_float("max_gradient_norm", 5.0,gradients to this norm.") tf.app.flags.DEFINE_integer("batch_size", 128,size to use during training.") tf.app.flags.DEFINE_integer("size", 256, "Size of each model layer.") tf.app.flags.DEFINE_integer("load_model", 0, "which model to load.") tf.app.flags.DEFINE_integer("beam_size", 20, "Size of beam.") tf.app.flags.DEFINE_integer("embedding_size", 100, "Size of word embedding.") tf.app.flags.DEFINE_integer("emotion_size", 100, "Size of emotion embedding.") tf.app.flags.DEFINE_integer("imemory_size", 256, "Size of imemory.") tf.app.flags.DEFINE_integer("category", 6, "category of emotions.") tf.app.flags.DEFINE_integer("num_layers", 2, "Number of layers in the model.") tf.app.flags.DEFINE_integer("response_vocab_size", 40000, "response vocabulary size.") tf.app.flags.DEFINE_integer("post_vocab_size", 40000, "post vocabulary size.") tf.app.flags.DEFINE_string("data_dir", "/content", "Data directory") tf.app.flags.DEFINE_string("train_dir", "train", "Training directory.") tf.app.flags.DEFINE_string("pretrain_dir", "pretrain", "Pretraining directory.") tf.app.flags.DEFINE_integer("pretrain", -1, "pretrain model number") tf.app.flags.DEFINE_integer("max_train_data_size", 0,"Limit on the size of training data (0: no limit).") tf.app.flags.DEFINE_integer("steps_per_checkpoint", 1000, "How many training steps to do per checkpoint.")

此错误是否可能是由于我正在对其进行训练的数据集的大小所致?还是错误和数据集的大小之间没有联系?

PS:张量流版本为0.12

0 个答案:

没有答案