GaoQ1 / rasa_chatbot_cn

building a chinese dialogue system based on the newest version of rasa(基于最新版本rasa搭建的对话系统)
965 stars 288 forks source link

训练core时出现dimension错误 #59

Closed nihuizhidao closed 5 years ago

nihuizhidao commented 5 years ago

在运行 make run ,当core训练到100%后,紧接着出现了下面的错误:

Traceback (most recent call last): File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\framework\ops.py", line 1659, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension must be 5 but is 4 for 'attention_1/transpose_7' (op: 'Transpose') with input shapes: [?,16,?,16,?], [4].

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\anaconda3\envs\rasa_gao\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\anaconda3\envs\rasa_gao\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Anaconda3\envs\rasa_gao\Scripts\rasa.exe__main.py", line 9, in File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa__main__.py", line 76, in main cmdline_arguments.func(cmdline_arguments) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\cli\train.py", line 77, in train kwargs=extract_additional_arguments(args), File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\train.py", line 40, in train kwargs=kwargs, File "d:\anaconda3\envs\rasa_gao\lib\asyncio\base_events.py", line 484, in run_until_complete return future.result() File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\train.py", line 87, in train_async kwargs, File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\train.py", line 169, in _train_async_internal kwargs=kwargs, File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\train.py", line 203, in _do_training kwargs=kwargs, File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\train.py", line 331, in _train_core_with_validated_data kwargs=kwargs, File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\core\train.py", line 66, in train agent.train(training_data, kwargs) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\core\agent.py", line 713, in train self.policy_ensemble.train(training_trackers, self.domain, kwargs) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\core\policies\ensemble.py", line 90, in train policy.train(training_trackers, domain, **kwargs) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\rasa\core\policies\keras_policy.py", line 189, in train shuffled_X.shape[1:], shuffled_y.shape[1:] File "D:\Downloads\rasa_chatbot_cn\rasa_chatbot_cn-master\policy\attention_policy.py", line 37, in model_architecture O_seq = Attention(16, 64)([embeddings, embeddings, embeddings]) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\keras\engine\base_layer.py", line 451, in call output = self.call(inputs, *kwargs) File "D:\Downloads\rasa_chatbot_cn\rasa_chatbot_cn-master\policy\attention_keras.py", line 107, in call A = K.permute_dimensions(A, (0, 3, 2, 1)) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\keras\backend\tensorflow_backend.py", line 2203, in permute_dimensions return tf.transpose(x, perm=pattern) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\ops\array_ops.py", line 1674, in transpose ret = transpose_fn(a, perm, name=name) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 10237, in transpose "Transpose", x=x, perm=perm, name=name) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func return func(args, **kwargs) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op op_def=op_def) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\framework\ops.py", line 1823, in init__ control_input_ops) File "d:\anaconda3\envs\rasa_gao\lib\site-packages\tensorflow\python\framework\ops.py", line 1662, in _create_c_op raise ValueError(str(e)) ValueError: Dimension must be 5 but is 4 for 'attention_1/transpose_7' (op: 'Transpose') with input shapes: [?,16,?,16,?], [4]. make: *** [train] Error 1

请问这个是什么问题?

ZihaoTan commented 5 years ago

一样的问题

zengande commented 5 years ago

请问你是否解决?

nihuizhidao commented 5 years ago

没有解决,只能查到是batch_dot那里出错了

zengande commented 5 years ago

没有解决,只能查到是batch_dot那里出错了

我暂时只能替换这个policy

nihuizhidao commented 5 years ago

没有解决,只能查到是batch_dot那里出错了

我暂时只能替换这个policy

你知道有没有英文版的pipeline,使用bert时,用什么tokenizer比较好?WhiteSpaceTokenizer的效果不好

zengande commented 5 years ago

没有解决,只能查到是batch_dot那里出错了

我暂时只能替换这个policy

你知道有没有英文版的pipeline,使用bert时,用什么tokenizer比较好?WhiteSpaceTokenizer的效果不好 试试官方文档,其他我就不清楚了

acmonde commented 5 years ago

我也是遇到了这个问题,原来还能跑,重新clone后就不行,找了一圈,发现只要把keras版本改为2.2.4就可以了

nihuizhidao commented 5 years ago

我也是遇到了这个问题,原来还能跑,重新clone后就不行,找了一圈,发现只要把keras版本改为2.2.4就可以了

非常感谢!