Salvatore Nedia
Salvatore Nedia

Reputation: 352

AMPL CreateProcess(".\snopt.exe") failure! Error code 2

I'm solving an svm problem with ampl (both primal and dual form).The model should be correct and indeed it compiles without errors but I get the following error message:

CreateProcess(".\snopt.exe") failure! Error code 2.

these are my models:

primal form

param n;

param x{i in{1..n}, j in{1..2} };

param y{i in{1..n}};

var w{i in{1..2}};
var b;

# objective function

minimize obj: 1/2 * sum{i in{1..2}}( w[i]^2 );

subject to c1 {i in {1..n}}:  y[i] * ( sum{j in {1..2}} ( w[j] * x[i,j] ) + b ) >= 1;

dual form:

reset;

param l;
param C := 10;


var lambda{1..l}>=0, <= C; 
param x{i in{1..l}, j in{1..2} };
param y{i in{1..l}};

minimize obj : 1/2*sum{i in 1..l}lambda[i]*y[i]*sum{k in 1..2}x[i,k]*
                            sum{j in 1..l}lambda[j]*y[j]*x[j,k];

s.t.  vincolo1: sum{i in 1..l}lambda[i]*y[i]=0;

and model.dat

param n:=10;
#param l:=10;

param x : 1 2  :=
1   -1  7   
2   -2  5   
3   2   5   
4   -2  1   
5   0   -1  
6   -4  3   
7   0   3   
8   3   0   
9   4   3   
10  2   8;

param y :=
1   1
2   1
3   1
4   1
5   1
6   -1
7   -1
8   -1
9   -1
10  -1;

Upvotes: 0

Views: 577

Answers (1)

4er
4er

Reputation: 211

The message CreateProcess(".\snopt.exe") failure! occurs when Windows is unable to execute .\snopt.exe on your computer. To confirm that this file is not executable, try the Windows command .\snopt.exe -v (or equivalently snopt.exe -v) which simply asks SNOPT to display a version string. To fix the problem, download a fresh copy of file snopt.exe; there's a copy in the AMPL demo bundle that will work with whatever license file you have.

Upvotes: 0

Related Questions