d9w / CartesianGeneticProgramming.jl

Cartesian Genetic Programming for Julia
Other
70 stars 25 forks source link

Setting up with Julia v1.0.0 #6

Closed TK-21st closed 4 years ago

TK-21st commented 6 years ago

I'm new to Julia so pardon me if the questions are n00b, but here's the issue:

Problem

  1. Does not include "PaddedViewer" in depencency (fixed by manually changing deps in environment)
  2. running julia dev/CGP/experiments/xor.jl, get back
    ERROR: LoadError: MethodError: Cannot `convert` an object of type Nothing to an object of type Union{UUID, Bool}
    Closest candidates are:
    convert(::Type{T}, !Matched::T) where T at essentials.jl:154
    Stacktrace:
    [1] explicit_manifest_deps_get(::String, ::Base.UUID, ::String) at ./loading.jl:478
    [2] manifest_deps_get(::String, ::Base.PkgId, ::String) at ./loading.jl:307
    [3] identify_package(::Base.PkgId, ::String) at ./loading.jl:203
    [4] identify_package at ./loading.jl:196 [inlined]
    [5] require(::Module, ::Symbol) at ./loading.jl:812
    [6] include at ./boot.jl:317 [inlined]
    [7] include_relative(::Module, ::String) at ./loading.jl:1038
    [8] include(::Module, ::String) at ./sysimg.jl:29
    [9] top-level scope at none:2
    [10] eval at ./boot.jl:319 [inlined]
    [11] eval(::Expr) at ./client.jl:389
    [12] top-level scope at ./none:3
    in expression starting at /home/tingkailiu/.julia/dev/CGP/src/CGP.jl:4
    ERROR: LoadError: Failed to precompile CGP [4fd9c4f4-07f5-549d-bd68-3a67ae5bbbb9] to /home/tingkailiu/.julia/compiled/v1.0/CGP/0AjpJ.ji.
    Stacktrace:
    [1] error(::String) at ./error.jl:33
    [2] macro expansion at ./logging.jl:313 [inlined]
    [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1184
    [4] _require(::Base.PkgId) at ./logging.jl:311
    [5] require(::Base.PkgId) at ./loading.jl:852
    [6] macro expansion at ./logging.jl:311 [inlined]
    [7] require(::Module, ::Symbol) at ./loading.jl:834
    [8] include at ./boot.jl:317 [inlined]
    [9] include_relative(::Module, ::String) at ./loading.jl:1038
    [10] include(::Module, ::String) at ./sysimg.jl:29
    [11] exec_options(::Base.JLOptions) at ./client.jl:229
    [12] _start() at ./client.jl:421
    in expression starting at /home/tingkailiu/.julia/dev/CGP/experiments/xor.jl:1

Thanks for open-sourcing this code, been meaning to trying out the algorithms in the recent Atari paper for a while.

d9w commented 6 years ago

I've still been using this with 0.6. I plan on updating it to 1.0 soon but haven't had the time yet. Thank you for your patience.

seb-ehm commented 6 years ago

I also ran into some problems with Julia 1.0.0. I am new at Julia as well, so I can't fix them on my own:

  1. PaddedViewer, Distributions, YAML and ArgParse aren't included as package dependencies
  2. Running julia run_tests.jl I get:
    ┌ Warning: Package CGP does not have PaddedViews in its dependencies:
    │ - If you have CGP checked out for development and have
    │   added PaddedViews as a dependency but haven't updated your primary
    │   environment's manifest file, try `Pkg.resolve()`.
    │ - Otherwise you may need to report an issue with CGP
    └ Loading PaddedViews into CGP from project dependency, future warnings for CGP are suppressed.
    ERROR: LoadError: UndefVarError: INFO not defined
    Stacktrace:
     [1] top-level scope at none:0
     [2] include at .\boot.jl:317 [inlined]
     [3] include_relative(::Module, ::String) at .\loading.jl:1038
     [4] include(::Module, ::String) at .\sysimg.jl:29
     [5] top-level scope at none:2
     [6] eval at .\boot.jl:319 [inlined]
     [7] eval(::Expr) at .\client.jl:389
     [8] top-level scope at .\none:3
    in expression starting at C:\Users\fixc3hp\.julia\dev\CGP\src\CGP.jl:7

    If I remove line 7 in CGP.jl, the next error I get is:

ERROR: LoadError: LoadError: MethodError: no method matching Array{Function,N} where N(::Int64)
Closest candidates are:
  Array{Function,N} where N(!Matched::UndefInitializer, !Matched::Int64) where T at boot.jl:408
  Array{Function,N} where N(!Matched::UndefInitializer, !Matched::Int64, !Matched::Int64) where T at boot.jl:409
  Array{Function,N} where N(!Matched::UndefInitializer, !Matched::Int64, !Matched::Int64, !Matched::Int64) where T at boot.jl:410
  ...
Stacktrace:
 [1] top-level scope at none:0
 [2] include at .\boot.jl:317 [inlined]
 [3] include_relative(::Module, ::String) at .\loading.jl:1038
 [4] include at .\sysimg.jl:29 [inlined]
 [5] include(::String) at C:\Users\fixc3hp\.julia\dev\CGP\src\CGP.jl:1
 [6] top-level scope at none:0
 [7] include at .\boot.jl:317 [inlined]
 [8] include_relative(::Module, ::String) at .\loading.jl:1038
 [9] include(::Module, ::String) at .\sysimg.jl:29
 [10] top-level scope at none:2
 [11] eval at .\boot.jl:319 [inlined]
 [12] eval(::Expr) at .\client.jl:389
 [13] top-level scope at .\none:3
in expression starting at C:\Users\fixc3hp\.julia\dev\CGP\src\config.jl:9
in expression starting at C:\Users\fixc3hp\.julia\dev\CGP\src\CGP.jl:9

This line can be fixed by replacing it with functions = Array{Function}(undef,0), but then there are more errors.

d9w commented 4 years ago

new version works with Julia 1.5.0