Closed Fidelxyz closed 4 years ago
需要手动创建 .../workspace/train_data 目录
手动创建目录后问题已解决,但构建训练模型时出现问题,报错信息如下:
Sun Apr 12 15:29:59 2020 构建训练模型...
Traceback (most recent call last):
File "/Users/xxx/Documents/GitHub/Ossas_ChatBot/main.py", line 109, in <module>
rnn.setup_model()
File "/Users/xxx/Documents/GitHub/Ossas_ChatBot/Seq2Seq.py", line 134, in setup_model
attention = Flatten()(attention)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 781, in __call__
self._set_mask_metadata(inputs, outputs, previous_mask)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 842, in _set_mask_metadata
output_mask = self.compute_mask(inputs, previous_mask)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1036, in compute_mask
raise TypeError('Layer ' + self.name + ' does not support masking, '
TypeError: Layer flatten does not support masking, but was passed an input_mask: Tensor("encoder_Embedding/NotEqual:0", shape=(?, ?), dtype=bool)
代码当前使用的tensorflow版本为2.1.0, 在python版本为3.7下运行正常。 能否尝试更换tensorflow版本?
更换版本后问题已解决。 Thanks!
另外报告一个小问题:xlsxwriter
也应被写进requirements.txt
里。
requirements已更新。感谢
Python版本:3.8.2 MacOS下clone项目代码编译运行。
在搭建模型时,报错为无法找到
words_dictionary.txt
。