rgcottrell / pytorch-human-performance-gec

A PyTorch implementation of "Reaching Human-level Performance in Automatic Grammatical Error Correction: An Empirical Study"
Apache License 2.0
50 stars 19 forks source link

TypeError: expected str, bytes or os.PathLike object, not NoneType #2

Closed jiusigua closed 4 years ago

jiusigua commented 5 years ago

@rgcottrell Hi, I test the model by generate-lang8-cnn.bat ,but I got a trouble: Namespace(beam=5, cpu=False, data=['../data-bin/lang-8-fairseq'], diverse_beam_groups=1, diverse_beam_strength=0.5, fp16=False, fp16_init_scale=128, gen_subset='test', iter=500, lang_model_data=None, lang_model_path=None, left_pad_source='True', left_pad_target='False', lenpen=1, log_format=None, log_interval=1000, max_len_a=0, max_len_b=200, max_sentences=128, max_source_positions=1024, max_target_positions=1024, max_tokens=None, min_len=1, model_overrides='{}', n=4, nbest=1, no_beamable_mm=False, no_early_stop=False, no_progress_bar=False, num_shards=1, path='../checkpoints/lang-8-fairseq-cnn/checkpoint_best.pt', prefix_size=0, print_alignment=False, quiet=False, raw_text=False, remove_bpe=None, replace_unk=None, sampling=False, sampling_temperature=1, sampling_topk=-1, score_reference=False, seed=1, sent=False, shard_id=0, skip_invalid_size_inputs_valid_test=False, source_lang=None, target_lang=None, task='translation', unkpen=0, unnormalized=False, upsample_primary=1) | [en] dictionary: 137960 types | [gec] dictionary: 121816 types | ../data-bin/lang-8-fairseq test 5257 examples | ['../data-bin/lang-8-fairseq'] test 5257 examples | loading model(s) from ../checkpoints/lang-8-fairseq-cnn/checkpoint_best.pt Traceback (most recent call last): File "./generate.py", line 236, in <module> main(args) File "./generate.py", line 93, in main fluency_scorer = FluencyScorer(args.lang_model_path, args.lang_model_data) File "/home/gpower/zhangtianjiu/NLP/pytorch-human-performance-gec-master/fairseq-scripts/fluency_scorer.py", line 58, in __init__ self.task = tasks.setup_task(self.args) File "/home/gpower/zhangtianjiu/NLP/pytorch-human-performance-gec-master/fairseq/fairseq/tasks/__init__.py", line 19, in setup_task return TASK_REGISTRY[args.task].setup_task(args) File "/home/gpower/zhangtianjiu/NLP/pytorch-human-performance-gec-master/fairseq/fairseq/tasks/language_modeling.py", line 90, in setup_task dictionary = Dictionary.load(os.path.join(args.data, 'dict.txt')) File "/home/gpower/anaconda3/envs/tf/lib/python3.6/posixpath.py", line 78, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType I looked at a lot of relevant solutions on the StackOverflow, but still no solution. can you help? My environment used for the development is Linux + Python 3.6.3 + CUDA 9.0 + pytorch 0.4.1. And I train model is no problem.

wulouzhu commented 5 years ago

Hello, do you know how to download the lang-8-en-1.0.zip data?

wulouzhu commented 5 years ago

I met the same problem, have you solved it?

PuJes commented 4 years ago

I have the same problem!

tianfeichen commented 4 years ago

We developed this on Windows using CUDA 9.2 so I haven't seen these error before.