Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError #12

Open
zhang-jinyi opened this issue Jun 3, 2019 · 8 comments
Open

FileNotFoundError #12

zhang-jinyi opened this issue Jun 3, 2019 · 8 comments

Comments

@zhang-jinyi
Copy link

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
Copy link

hi zhang-jinyi,

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

@ningqiuyi
Copy link

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

@sevilaybayatli
Copy link

sevilaybayatli commented Jul 13, 2019 via email

@ningqiuyi
Copy link

ningqiuyi commented Jul 15, 2019

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
Copy link

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
Copy link

toshohirasawa commented Dec 6, 2019

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
Copy link

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
Copy link

d-ks commented Apr 29, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants