Oh, of course. I've now changed the script to use Popen.communicate() to get the output and to wait for the process to end. The new script is available here: http://koti.mbnet.fi/~ilaripih/bin/clop ... ess-cli.pymcostalba wrote:After 4 hours of hardcore hacking I was able to setup the thing on Windows 7 with Qt SDK mingw compiler.
Regarding your script I needed to change the following:
because on Windows there is not support for pid:Code: Select all
sts = os.waitpid(process.pid, 0)
http://stackoverflow.com/questions/6647 ... -processes
So I workaround with:
Code: Select all
process.wait()
To Ilari : CLOP + cutechess-cli
Moderators: hgm, Rebel, chrisw
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: To Ilari : CLOP + cutechess-cli
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: To Ilari : CLOP + cutechess-cli
Sorry about that. Unless they're something unrelated to the CLOP parameters you should NOT set the "initstr" values in the engines.json file. The "clop-cutechess-cli.py" script will send those parameters to cutechess-cli.Daniel Shawul wrote:Gee.I spent hours but I couldn't make it through apparently because of the bug you discovered.sts = os.waitpid(process.pid, 0)
I still have problems with cutechess-cli .json file which seems to ignore inisstring. Some uci engines take all the processors unless told to use threads=1.
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: To Ilari : CLOP + cutechess-cli
Actually the correct one for UCI options is 'setoption name {name} value {value}'.mcostalba wrote: You may want to set:
in clop-cutechess.py instead of the shippedCode: Select all
engine_param_cmd = 'setoption {name} value {value}'
The former seems the correct one for UCI engines, I don't know when is used the second one....Code: Select all
engine_param_cmd = 'setvalue {name} {value}'
Regarding the second syntax, I figured that some would want to optimize parameters that are not UCI options, and their engine might have its own syntax for setting these parameters. For example in Sloppy I'm now using the "setvalue {name} {value}" syntax.
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: To Ilari : CLOP + cutechess-cli
I don't think you have to do it, you just need to call the Python interpreter and give it the script as a parameter. So you'd have something like this in the .clop file:mcostalba wrote:...then I was unable to make the windows version of CLOP to launch the python glue script DummyScript.py, perhaps is because I missed something, anyhow after a good time spent googling+hacking around I workaround the issue converting the script in an exe file...
Code: Select all
Script C:\Python26\python.exe clop-cutechess-cli.py
-
- Posts: 4185
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: To Ilari : CLOP + cutechess-cli
Not to forget about winboard 2 engines which have "option value":) Anyway I run my first optimization overnight and got a small improvement with QLR. It was a self test against older version. It had difficulties but in the end came up with new values that improved it slightly.
Default scorpio:
New values:
Default scorpio:
Code: Select all
LAZY_MARGIN_MIN 150
LAZY_MARGIN_MAX 300
Code: Select all
LAZY_MARGIN_MIN 270
LAZY_MARGIN_MAX 425
Samples = 14213
TotalWeight = 10479.4
Wins = 4979
Draws = 4312
Losses = 4922
WinningRate = 0.502005
-
- Posts: 4185
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: To Ilari : CLOP + cutechess-cli
I think communicate has problems.
Code: Select all
2011-10-16 09:13:05 id = 2 (machine1); Seed = 14567; Error: No Outcome.
StandardOutput:
StandardError:
Traceback (most recent call last):
File "clop-cutechess-cli.py", line 119, in <module>
sys.exit(main())
File "clop-cutechess-cli.py", line 103, in main
for line in process.stdout:
ValueError: I/O operation on closed file
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: To Ilari : CLOP + cutechess-cli
Did you try the new script that I uploaded? Because it doesn't have the "for line in process.stdout" line anymore. Instead it parses the output returned by Popen.communicate()[0]Daniel Shawul wrote:I think communicate has problems.Code: Select all
2011-10-16 09:13:05 id = 2 (machine1); Seed = 14567; Error: No Outcome. StandardOutput: StandardError: Traceback (most recent call last): File "clop-cutechess-cli.py", line 119, in <module> sys.exit(main()) File "clop-cutechess-cli.py", line 103, in main for line in process.stdout: ValueError: I/O operation on closed file
-
- Posts: 4185
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: To Ilari : CLOP + cutechess-cli
My fault. I didn't want to loose the working directories I alread set, so I replaced only part of the code I though was problematic i.e around process.wait(). Using the new script now works as intended. Thanks.
-
- Posts: 4185
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: To Ilari : CLOP + cutechess-cli
I think QLR has a very high tendency to get stuck in a local maxima. Since it does not use initial guesses it will have difficulty improving upon hand selected values. I don't know if CLOP has improvemetns over QLR in this regard.
Eg. Default mobility weight of 16 for all pieces.
QLR came up with new values that almost doubles the default values (even 3x for the queen) that is clearly beaten by the default. It would have been great if it can initialize from user suggested values... It is early days but I don't think it can improve much.
Eg. Default mobility weight of 16 for all pieces.
Code: Select all
IntegerParameter KNIGHT_MOB 0 64
IntegerParameter BISHOP_MOB 0 64
IntegerParameter ROOK_MOB 0 64
IntegerParameter QUEEN_MOB 0 64
Code: Select all
KNIGHT_MOB 31
BISHOP_MOB 25
ROOK_MOB 31
QUEEN_MOB 42
Samples = 692
TotalWeight = 475.101
Wins = 190
Draws = 175
Losses = 327
WinningRate = 0.401012
-
- Posts: 2272
- Joined: Mon Sep 29, 2008 1:50 am
Re: To Ilari : CLOP + cutechess-cli
I think I observed something similar. But I am not sure.I think QLR has a very high tendency to get stuck in a local maxima.
Well it can, but currently this requires some manual input. First generate samples in a small window around the suggested values. Then enlarge the window to a wide one.It would have been great if it can initialize from user suggested values...
Last edited by Michel on Sun Oct 16, 2011 4:30 pm, edited 1 time in total.