如何解决使用 FB XLM 遇到数据路径问题os.path.isdir(path) 在它存在时返回 false
我正在尝试对实现 FB 的 XLM(跨语言模型)的 FB 转码器 (https://github.com/facebookresearch/TransCoder) 进行评估:https://github.com/facebookresearch/XLM#iii-applications-supervised--unsupervised-mt
我已配置好所有内容,并按照运行验证/测试集的 github 页面中的说明进行操作,将它们解压缩并将它们放入特定目录:/home/username/TransCoder/data/bpe.cpp-java-python.with_comments/XLM-cpp-java-python-with-comments-functions-sa-cl-split-test
。
当我运行运行评估部分中的以下命令时:
python XLM/train.py
--n_heads 8
--bt_steps 'python_sa-cpp_sa-python_sa,cpp_sa-python_sa-cpp_sa,java_sa-cpp_sa-java_sa,cpp_sa-java_sa-cpp_sa,python_sa-java_sa-python_sa,java_sa-python_sa-java_sa' # The evaluator will use this parameter to infer the languages to test on
--max_vocab '-1'
--word_blank '0.1'
--n_layers 6
--generate_hypothesis true
--max_len 512
--bptt 256
--fp16 true
--share_inout_emb true
--tokens_per_batch 6000
--has_sentences_ids true
--eval_bleu true
--split_data false
--data_path '/home/salzubi/TransCoder/data/bpe.cpp-java-python.with_comments/XLM-cpp-java-python-with-comments-functions-sa-cl-split-test'
--eval_computation true
--batch_size 32
--reload_model 'model_1.pth,model_1.pth'
--amp 2
--max_batch_size 128
--ae_steps 'cpp_sa,python_sa,java_sa'
--emb_dim 1024
--eval_only True
--beam_size 10
--retry_mistmatching_types 1
--dump_path '/tmp/'
--exp_name='eval_final_model_wc_30'
--lgs 'cpp_sa-java_sa-python_sa'
--encoder_only=False
我收到以下错误:
Traceback (most recent call last):
File "XLM/train.py",line 337,in <module>
check_data_params(params)
File "/home/username/TransCoder/XLM/src/data/loader.py",line 246,in check_data_params
assert os.path.isdir(params.data_path),params.data_path
AssertionError
我不知道为什么会这样?
$ python
import os
print(os.path.isdir("/home/username/TransCoder/data/bpe.cpp-java-python.with_comments/XLM-cpp-java-python-with-comments-functions-sa-cl-split-test"))
output:
True
关于如何解决这个问题有什么想法吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。