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

Version Problems? #269

Closed
howard4086 opened this issue Sep 23, 2014 · 22 comments
Closed

Version Problems? #269

howard4086 opened this issue Sep 23, 2014 · 22 comments

Comments

@howard4086
Copy link

I have been using JuMP to solve a MILP (with CBC), and it seems the latest version doesn't work with my code. When I tried to create a model with Cbc as the solver the code below returned an error:
m=Model(solver=CbcSolver(MipMaxSeconds=30,MipFractionalGap=MIPGAP,LogLevel=CBCLogLevel))

This would not work with the latest version of Clp/Cbc, so I pinned it back and it works fine now. Also - I'm use Julia Studio, so I'm on v0.2.0 of Julia (perhaps that is the problem?) I didn't know if the command has changed in the latest version of Clp or JuMP, or if it is a compatibility error with my older version of Julia? Its not a huge deal as it works with the older packages, but I wanted to understand why it was necessary.

Here are my Package versions: (that work with the command above)

  • Clp 0.0.8 pinned.aac279f6.tmp
  • JuMP 0.5.5
  • BinDeps 0.3.5
  • Calculus 0.1.3
  • Cbc 0.0.7

Thanks!

-Nick

@mlubin
Copy link
Member

mlubin commented Sep 23, 2014

What's the error that you're receiving? The names of the Cbc parameters have recently changed, take a look at: https://github.com/JuliaOpt/Cbc.jl. The latest version of JuMP/Clp/Cbc requires julia 0.3.0. If you're on 0.2, you should still have a working set of packages though.

@howard4086
Copy link
Author

When I use the latest packages I get the following:
LoadError("MIP_Generic.jl",106,ErrorException("CbcSolver not defined"))

@howard4086
Copy link
Author

Perhaps an incompatibility with Julia 0.2.0?

@mlubin
Copy link
Member

mlubin commented Sep 23, 2014

Is there any error when you say using Cbc in a clean Julia session?

@howard4086
Copy link
Author

No there isn't, but I gave the wrong error (when I freed the package I hadn't re-built Cbc). using Cbc works fine, and m=Model() works fine, but trying to specify the solver in any way to be CbcSolver results in:
LoadError("MIP_Generic.jl",106,MethodError(Model,(0,:Min,[],[],[],0,[],[],[],[],0,[],[],[],nothing,CbcSolver({(:MipMaxSeconds,30.0),(:MipFractionalGap,0.01),(:LogLevel,0)}),false,nothing,nothing,nothing,[],IndexedVector{Float64}([],[],0),nothing,Dict{Symbol,Any}())))

@mlubin
Copy link
Member

mlubin commented Sep 23, 2014

I wasn't able to reproduce this issue on a clean install of julia 0.2. You might have a weird mix of package versions installed. Could you try clearing your packages (delete the directory reported by Pkg.dir()) and installing a fresh copy of everything? You shouldn't need to pin any versions.

@howard4086
Copy link
Author

I cleared it and reinstalled all the packages and still get the error if I don't pin Clp. I wonder if its due to the julia-readline.exe interpreter that Julia Studio uses?

@joehuchette
Copy link
Contributor

I think that JuliaStudio isn't handling the errors particularly gracefully, which is why you see the LoadError. There's definitely an error propagating up from the library, though.

@joehuchette
Copy link
Contributor

@howard4086 could you report what version of MathProgBase you have installed? I'm wondering if you're running a 0.3.0-dev version.

@howard4086
Copy link
Author

Here is my current set of packages:

  • Clp 0.0.8 pinned.aac279f6.tmp
  • JuMP 0.5.5
  • Logging 0.0.4
  • PyCall 0.4.9
  • BinDeps 0.3.5
  • Calculus 0.1.3
  • Cbc 0.0.7
  • DataStructures 0.2.15
  • DualNumbers 0.1.0
  • Graphs 0.3.1
  • MathProgBase 0.2.5
  • ReverseDiffSparse 0.1.2
  • SHA 0.0.3
  • URIParser 0.0.2

@joehuchette
Copy link
Contributor

I think what's going on is that there's an incompatibility with the MathProgBase v0.2.5 interface and the way Clp v0.0.8 tries to plug into it (this manifests itself with the no-method error you reported above). METADATA should be changed to reflect this, which would mean Clp v0.0.7 is an upper bound for your set up and which (I hope!) should fix this.

@mlubin
Copy link
Member

mlubin commented Sep 23, 2014

On a clean 0.2:

julia> Pkg.status()
Required packages:
 - Cbc                           0.0.8
 - Clp                           0.0.9
 - JuMP                          0.5.7
Additional packages:
 - BinDeps                       0.3.5
 - Calculus                      0.1.3
 - DataStructures                0.2.15
 - DualNumbers                   0.1.0
 - Graphs                        0.3.1
 - MathProgBase                  0.3.0
 - ReverseDiffSparse             0.1.2
 - SHA                           0.0.3
 - URIParser                     0.0.2

The solver versions are compatible with MPB 0.3.0. @howard4086, could you post Pkg.status() with everything unpinned? Also a small piece of code that reproduces the issue would be helpful.

@howard4086
Copy link
Author

I'm using Julia 0.2, but through Julia Studio, which actually calls julia-readline.exe.

Here is my Pkg.status():
Required packages:

  • Clp 0.0.9
  • JuMP 0.5.7
  • Logging 0.0.4
  • PyCall 0.4.9
    Additional packages:
  • BinDeps 0.3.5
  • Calculus 0.1.3
  • Cbc 0.0.8
  • DataStructures 0.2.15
  • DualNumbers 0.1.0
  • Graphs 0.3.1
  • MathProgBase 0.3.0
  • ReverseDiffSparse 0.1.2
  • SHA 0.0.3
  • URIParser 0.0.2

Then here is the code:
using Cbc
using JuMP
m=Model(solver=CbcSolver())

This generates:
MethodError(Model,(0,:Min,[],[],[],0,[],[],[],[],0,[],[],[],nothing,CbcSolver({}),false,nothing,nothing,nothing,[],IndexedVector{Float64}([],[],0),nothing,Dict{Symbol,Any}()))

@mlubin
Copy link
Member

mlubin commented Sep 23, 2014

I think I've fixed the issue, try Pkg.checkout("JuMP", "release-0.5"). We can release JuMP 0.5.8 for this.

@howard4086
Copy link
Author

When I run:
Pkg.checkout("JuMP", "release-0.5")

I get:
INFO: Checking out JuMP release-0.5...
error: pathspec 'release-0.5' did not match any file(s) known to git.
ErrorException("failed process: Process(git '--work-tree=\\.julia\\JuMP' '--git-dir=\\.julia\\JuMP\\.git' checkout -q release-0.5, ProcessExited(1)) [1]")

@mlubin
Copy link
Member

mlubin commented Sep 24, 2014

Try Pkg.update(); Pkg.checkout("JuMP, "b4c79f4ce6")

@howard4086
Copy link
Author

I get this error:

INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove.
INFO: Checking out JuMP b4c79f4...
error: pathspec 'b4c79f4ce6' did not match any file(s) known to git.

@mlubin
Copy link
Member

mlubin commented Sep 24, 2014

Not sure why that's not working, but I just released JuMP 0.5.8 with the fix. Try Pkg.update() now.

@howard4086
Copy link
Author

Good news is that it now works! Thanks!

However, it appears the latest version has changed the syntax of Variable?

I have been using Variable() to create my variables one at a time as I am using dictionaries with indices not static at compile time based on the problem data files (which can change depending on the data loaded). In the past this worked just fine using:
Variable(m,0,10,1) or Variable(m,0,Inf,0) for an integer or continuous variable for example.

Now when I call this I get:
MethodError(Variable,(Feasibility problem with:

  • 0 linear constraints
  • 0 variables
    Solver set to Cbc,0,Inf,0)))

What am I doing wrong here?

Thanks!

@mlubin
Copy link
Member

mlubin commented Sep 25, 2014

@howard4086 The final argument for Variable is now :Int, :Bin, or :Cont for integer, binary, and continuous variables respectively. We forgot to update the documentation: #272.

But anyway there's no restriction on variable indices being defined at compile time. You can do something like:

S = {}
# fill S using input data
@defVar(m, x[S])

It shouldn't be necessary to use Variable().

@howard4086
Copy link
Author

Thats very nice - thanks. After fixing my variable declarations everything worked, except I found that CbcSolver did not respond to any options I specified:

m=Model(solver=CbcSolver(MipMaxSeconds=30,MipFractionalGap=.01,LogLevel=1)

This command ran and solved fine, but it solved to optimality, with the default LogLevel and took 72 seconds.

I found that the CoinMP.dll file was dated 9/13/2013, so I rolled it forward to a version dated 1/7/2014, and then everything worked fine. This morning I had cleared all of my packages and reinstalled clean, so the 9/13/2013 version is the default one it pulled down - perhaps this is a mistake and you should have the newer version instead?

Either way everything works well now with the latest packages. Thanks so much for the help!

@mlubin
Copy link
Member

mlubin commented Sep 25, 2014

The latest version of the Cbc wrapper (which requires julia 0.3) has newly updated binaries and renamed parameters, see https://github.com/JuliaOpt/Cbc.jl. This is just as a heads up for when you eventually update to julia 0.3.

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

No branches or pull requests

3 participants