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

Installation issue #1

Open
MateVaradi opened this issue May 14, 2020 · 1 comment
Open

Installation issue #1

MateVaradi opened this issue May 14, 2020 · 1 comment

Comments

@MateVaradi
Copy link

Hi! I am trying to use your model for my master thesis. When running the example you provided I am running into the following error message. Do you have any tips as to what is going wrong?

(base) C:\Users\m.varadi\Thesis\ldadf> python example.py -I

Select a constraint:
0)
1) ML("A","B")
2) CL("B", "C")
3) IL("B", "A")
4) ML("A", "B") | ML("A", "C")
5) IL("B", "A") & IL("C", "A")
6) ( ML("A", "B") | ML("A", "C") ) & CL("B", "C")
7) IL("B", "A") & IL("C", "A") & CL("B", "C")
8) ML("A", "B") & ML("A", "C")
9) ML("A", "B") & CL("B", "C")

Index> 0)
invalid literal for int() with base 10: '0)'

Select a constraint:
0)
1) ML("A","B")
2) CL("B", "C")
3) IL("B", "A")
4) ML("A", "B") | ML("A", "C")
5) IL("B", "A") & IL("C", "A")
6) ( ML("A", "B") | ML("A", "C") ) & CL("B", "C")
7) IL("B", "A") & IL("C", "A") & CL("B", "C")
8) ML("A", "B") & ML("A", "C")
9) ML("A", "B") & CL("B", "C")

Index> 2
= Parameters
dat_file: ./data/test.dat
lex_file: ./data/test.lex
cst_text: CL("B", "C")
eta: 100
seed: None
verbose: False

= Compile constraint links
python utils/compiler.py -c'CL("B", "C")' -l./data/test.lex -d./out/example/test.dnf
Traceback (most recent call last):
  File "utils/compiler.py", line 4, in <module>
    from parser import LinkParser, LinkParserException
ImportError: cannot import name 'LinkParser' from 'parser' (unknown location)

= Train LDADF with constraint links
The system cannot find the path specified.
./src/ldadf -n2 -m1000 -a1 -b0.01 -e100 -l10 -u5 -o./out/example/test -d./out/example/test.dnf ./data/test.dat
'.' is not recognized as an internal or external command,
operable program or batch file.

= Learned parameters
python utils/viewer.py -p./out/example/test.final -l./data/test.lex -d./out/example/test.dnf
Traceback (most recent call last):
  File "utils/viewer.py", line 182, in <module>
    out_file=args.out, verbose=args.verbose)
  File "utils/viewer.py", line 24, in __init__
    self.dnf.load(dnf_file, self.id2word)
  File "C:\Users\m.varadi\Thesis\ldadf\utils\dnf.py", line 30, in load
    with open(filename) as f:
FileNotFoundError: [Errno 2] No such file or directory: './out/example/test.dnf'

Select a constraint:
0)
1) ML("A","B")
2) CL("B", "C")
3) IL("B", "A")
4) ML("A", "B") | ML("A", "C")
5) IL("B", "A") & IL("C", "A")
6) ( ML("A", "B") | ML("A", "C") ) & CL("B", "C")
7) IL("B", "A") & IL("C", "A") & CL("B", "C")
8) ML("A", "B") & ML("A", "C")
9) ML("A", "B") & CL("B", "C")

Index>
@hakobayato
Copy link
Owner

Thanks for the comment. I have never checked my code in any windows environment, but the following modification might fix the problem. I confirmed it with MinGW+Anaconda.

  • compiler.py
#from parser import LinkParser, LinkParserException
import imp
imp.load_source('parser', 'utils/parser.py')
from parser import LinkParser, LinkParserException
  • example.py
        #cmd = 'python utils/compiler.py -c\'{}\' -l{} -d{}'.format(cst_text, lex_file, dnf_file)
        cmd = 'python utils/compiler.py -c\"{}\" -l{} -d{}'.format(cst_text.replace('"','\\\"'), lex_file, dnf_file)
...
    #if not os.path.exists('./src/ldadf'):
    #    os.system('cd src; make release')
    #cmd = './src/ldadf -n{} -m{} -a{} -b{} -e{} -l{} -u{} -o{}'.format(topic, step, alpha, beta, eta, loop, burn, out_pref)
    if not os.path.exists('src\\ldadf.exe'):
        os.system('cd src && mingw32-make')
    cmd = 'src\\ldadf.exe -n{} -m{} -a{} -b{} -e{} -l{} -u{} -o{}'.format(topic, step, alpha, beta, eta, loop, burn, out_pref)

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

2 participants