使用 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 (将#修改为@)