你好!
根据你提供的信息,这个问题可能是由于数据集的特征数量与模型输入特征不匹配导致的。在你的config.yaml
文件中,input_features
部分的Eu
特征的类型是text
,但实际上你的数据集中的Eu
特征是一个单词列表。你需要将Eu
特征的类型更改为tokens
,并设置一个合适的词汇表大小。同时,你需要确保output_features
部分的Chatbot
特征的类型也是tokens
。
请尝试按照以下步骤修改你的config.yaml
文件:
- 将
input_features
部分的Eu
特征的类型更改为tokens
,并设置一个合适的词汇表大小。例如,如果你的数据集中的最大单词数是256,你可以将词汇表大小设置为256:
input_features:
-
name: Eu
type: tokens
vocab_size: 256
level: word
encoder: rnn
cell_type: lstm
reduce_output: null
- 确保
output_features
部分的Chatbot
特征的类型也是tokens
,并设置一个合适的词汇表大小。例如,如果你的数据集中的最大单词数是256,你可以将词汇表大小设置为256:
output_features:
-
name: Chatbot
type: tokens
vocab_size: 256
level: word
decoder: generator
cell_type: lstm
attention: bahdanau
loss: sampled_softmax_cross_entropy
- 在运行实验之前,确保你的数据集已经正确地加载到Ludwig中。你可以使用以下命令来加载数据集:
ludwig experiment --dataset eu.csv --config_file config.yaml --no_cache --force_reload_dataloaders --skip_save_processed_data --skip_save_progress --skip_save_unprocessed_data --skip_save_model --skip_validation --verbose
希望这可以帮助你解决问题!
2条答案
按热度按时间1l5u6lss1#
感谢您提出这个问题。您的模型应该能在提供的数据显示出效果。我会去查看一下。同时,之前帮助解决序列解码问题的@jimthompson5802可能对此有独到的见解。
daupos2t2#
你好,你能解决这个问题吗?
在更新ludwig后,我遇到了相同的错误。之前使用pre tensroflow2更新相同的数据集和model_definition可以正常工作。但是在更新后,相同的代码和数据会报错: