artetxem / monoses

Unsupervised Statistical Machine Translation
GNU General Public License v3.0
228 stars 41 forks source link

FileNotFoundError #12

Open zhang-jinyi opened 5 years ago

zhang-jinyi commented 5 years ago

Hi, Sorry to trouble you, but I had this error:

ERROR: compile contrib/sigtest-filter at /home/zhang/data-short/monoses/third-party/moses/scripts/generic/binarize4moses2.perl line 34. ERROR: compile contrib/sigtest-filter at /home/zhang/data-short/monoses/third-party/moses/scripts/generic/binarize4moses2.perl line 34. Using SCRIPTS_ROOTDIR: /home/zhang/data-short/monoses/third-party/moses/scripts Not executable: /home/zhang/data-short/monoses/third-party/moses/bin/moses2 at /home/zhang/data-short/monoses/third-party/moses/scripts/training/mert-moses.pl line 466. Traceback (most recent call last): File "/home/zhang/.pyenv/versions/3.7.2/lib/python3.7/shutil.py", line 563, in move os.rename(src, real_dst) FileNotFoundError: [Errno 2] No such file or directory: 'cj-word-smt/tmpou08sq8q/mert/moses.ini' -> 'cj-word-smt/step7/src2trg.it1.moses.ini'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 484, in main() File "train.py", line 478, in main unsupervised_tuning(args) File "train.py", line 366, in unsupervised_tuning shutil.move(args.tmp + '/mert/moses.ini', config[(src, trg)]) File "/home/zhang/.pyenv/versions/3.7.2/lib/python3.7/shutil.py", line 577, in move copy_function(src, real_dst) File "/home/zhang/.pyenv/versions/3.7.2/lib/python3.7/shutil.py", line 263, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks) File "/home/zhang/.pyenv/versions/3.7.2/lib/python3.7/shutil.py", line 120, in copyfile with open(src, 'rb') as fsrc: FileNotFoundError: [Errno 2] No such file or directory: 'cj-word-smt/tmpou08sq8q/mert/moses.ini'

Is that the moses2 didn't been compiled?

sevilaybayatli commented 5 years ago

hi zhang-jinyi,

I have same problem, did it solve for you, please need help to solve that problem.

ningqiuyi commented 5 years ago

I had the same problem , then I replaced moses2 with moses .

sevilaybayatli commented 5 years ago

hey! any idea how to replace moses2 with moses. Also could you give a link please?

On Fri, Jul 12, 2019 at 10:20 AM qyNing notifications@github.com wrote:

I had the same problem , then I replaced moses2 with moses .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/artetxem/monoses/issues/12?email_source=notifications&email_token=AFNDDVWYQPXXTP3EEN22GHDP7AWDJA5CNFSM4HSG2LI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZY5UEY#issuecomment-510777875, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNDDVQQ4CFOXRJOSMBUYLDP7AWDJANCNFSM4HSG2LIQ .

ningqiuyi commented 5 years ago

You just need to replace the moses2 in the code with the moses in your path, but Moses and Moses2 aren't exactly alike, there's some differences in pruning, stack configuration etc. You can refer to this http://www.statmt.org/moses/?n=Site.Moses2

Lavine24 commented 5 years ago

Compile contrib/sigtest-filter: Step1: git clone https://github.com/moses-smt/salm.git Step2: cd Distribution/Linux Step3: make Step4: cd ~/mosesdecoder/contrib/sigtest-filter Step5: make SALMDIR=your salm path Done all this, work fine.

toshohirasawa commented 4 years ago

I had the same problem, and I have managed it by installing Moses2.

As Moses does not build Moses2 without specifying XMLRPC-c (1.39.12) and cmph (2.0), I need to build these dependencies first. http://www.statmt.org/moses/?n=Site.Moses2

XMLRPC-c: 1.39.12 cmph: 2.0

Now, use the command below to build Moses2.

./bjam --with-xmlrpc-c=/path/to/xmlrpc --with-cmph=/path/to/cmph -j4

For more details, manually execute each command corresponding to each step in train.py and you can find actual error messages.

shefs0709 commented 4 years ago

Hello toshohirasawa, Can you tell how to build xmlrpc? Or can you provide some link? I have tried installing it but getting an error.

d-ks commented 3 years ago

I'll leave you with my notes for building Moses. I hope it will be useful to someone else. This is a build procedure that I obtained through trial and error, relying on toshohirasawa's comment above, so please take it at your own risk. I installed it on my recently set up Ubuntu 20.04.1 LTS.

XMLRPC-c: 1.39.12 First, download it from here. https://sourceforge.net/projects/xmlrpc-c/files/Xmlrpc-c%20Super%20Stable/1.39.12/

If you run configure at this stage, you may get the following message and it may not work.

We are not building any client XML transport (see earlier messages explaining why), therefore WE WILL NOT BUILD THE CLIENT LIBRARY. 

So, you first install the library. sudo apt-get install libcurl4-gnutls-dev (reference: https://askubuntu.com/questions/748683/installing-xml-rpc-c)

Then, configure, make and install it.

./configure
make
sudo make install

cmph 2.0 First, download it from here. https://sourceforge.net/projects/cmph/files/cmph/cmph-2.0.tar.gz

Then, configure, make and install it.

./configure
make
sudo make install

Moses This is Moses as retrieved by get-third-party.sh. First, go to monoses > third-party > moses. Make sure you have boost in your system. If you don't have sudo apt install libboost-dev libboost-all-dev

Install libbz2-dev as well, as it may cause bz2-related errors. sudo apt-get install libbz2-dev

Build with the libraries that you have installed above. In my case, I ran a command like this. ./bjam --with-xmlrpc-c=/usr/local --with-cmph=/usr/local/include -j4

It will take a while, but when you see SUCCESS at the end, it's OK.