nusnlp / mlconvgec2018

Code and model files for the paper: "A Multilayer Convolutional Encoder-Decoder Neural Network for Grammatical Error Correction" (AAAI-18).
GNU General Public License v3.0
185 stars 73 forks source link

AssertionError when testing #5

Closed mojesty closed 6 years ago

mojesty commented 6 years ago

I used versions of fairseq that were provided by ./download.sh script in software dir, but got into trouble:

/local/path/mlconvgec2018/software/fairseq-py/generate.py", line 43, in main
    dataset = data.load_dataset(args.data, [args.gen_subset], args.source_lang, args.target_lang)
  File "/local/path/mlconvgec2018/software/fairseq-py/fairseq/data.py", line 54, in load_dataset
    assert src is not None and dst is not None, 'Source and target languages should be provided'

AssertionError: Source and target languages should be provided`

So I modified the line in run.sh and added --source-lang en --target-lang en but now it wants a dictionary from me. Can you help?

shamilcm commented 6 years ago

You seem to be using a different version of Fairseq from that in the download.sh script (https://github.com/nusnlp/mlconvgec2018/blob/master/software/download.sh#L1)

The Fairseq provided in the download.sh script does not have that error in Line 54. https://github.com/shamilcm/fairseq-py/blob/master/fairseq/data.py#L54

The FairSeq from the official repo (https://github.com/pytorch/fairseq/blob/master/fairseq/data.py#L54 ) has that error in line 54.

mojesty commented 6 years ago

Oh well, I restarted software/download.sh and run.sh gave me another error:

    from fairseq import libbleu
ImportError: cannot import name 'libbleu'
shamilcm commented 6 years ago

Did you run the setup.py following README (https://github.com/shamilcm/fairseq-py)? Note that the Fairseq version that we have used needs PyTorch 0.2.0post3 compiled from source.

jiusigua commented 5 years ago

@shamilcm Hi , When I run the setup.py following README, I got a error: (py3.5) gpower@gpower:~/zhangtianjiu/NLP/mlconvgec2018-master/software/fairseq-py/pytorch$ git reset --hard a03e5cb40938b6b3f3e6dbddf9cff8afdff72d1b HEAD is now at a03e5cb40 Remind users to submodule update. My development environment is Linux+ Anaconda3 + Python 3.6 + CUDA 9.0 How can I solve the problem?