TuringLang / Turing.jl

Bayesian inference with probabilistic programming.
https://turinglang.org
MIT License
2.03k stars 218 forks source link

Problem with Quick Start example #1339

Closed marcoxa closed 4 years ago

marcoxa commented 4 years ago

Hi

I have a problem on: https://github.com/TuringLang/Turing.jl/edit/master/docs/_docs/using-turing/quick-start.md

The following error is raised.

ERROR: LoadError: MethodError: no method matching get_color_palette(::Symbol, ::RGBA{Float64}, ::Int64)

This looks like a problem in StatsPlots, but it is a bit off-putting. I am using the latest Julia.

Any ideas?

All the best

Marco

devmotion commented 4 years ago

Which package versions do you use? Can you post the output of ] st --manifest in the Julia REPL (see https://julialang.github.io/Pkg.jl/v1/managing-packages/#Adding-registered-packages-1)?

marcoxa commented 4 years ago

Hi

let me answer in pieces.

First of all, on a W10 machine and Julia 1.4.1, things seem to work without problems.

The problem I have is on an Ubuntu machine

PoolTesting/tests$ uname -a
Linux giacinto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

The ] st --manifest yields the following. Look at the next answer for the result of testing.

(@v1.4) pkg> st --manifest
Status ~/.julia/environments/v1.4/Manifest.toml`
  [621f4979] AbstractFFTs v0.5.0
  [80f14c24] AbstractMCMC v1.0.1
  [1520ce14] AbstractTrees v0.3.3
  [79e6a3ab] Adapt v1.1.0
  [0bf59076] AdvancedHMC v0.2.25
  [5b7e9947] AdvancedMH v0.5.1
  [46ada45e] Agents v3.2.1
  [dce04be8] ArgCheck v2.0.0
  [ec485272] ArnoldiMethod v0.0.4
  [7d9fca2a] Arpack v0.4.0
  [68821587] Arpack_jll v3.5.0+3
  [4fba245c] ArrayInterface v2.9.0
  [13072b0f] AxisAlgorithms v1.0.0
  [39de3d68] AxisArrays v0.4.3
  [6e4b80f9] BenchmarkTools v0.5.0
  [76274a88] Bijectors v0.7.2
  [b99e7846] BinaryProvider v0.5.10
  [6e34b625] Bzip2_jll v1.0.6+2
  [324d7699] CategoricalArrays v0.8.1
  [aaaa29a8] Clustering v0.14.1
  [3da002f7] ColorTypes v0.10.4
  [5ae59095] Colors v0.12.2
  [861a8166] Combinatorics v1.0.2
  [bbf7d656] CommonSubexpressions v0.3.0
  [34da2185] Compat v3.12.0
  [e66e0078] CompilerSupportLibraries_jll v0.3.3+0
  [88cd18e8] ConsoleProgressMonitor v0.1.2
  [d38c429a] Contour v0.5.3
  [a10d1c49] DBInterface v2.2.0
  [9a962f9c] DataAPI v1.3.0
  [a93c6f00] DataFrames v0.21.3
  [864edb3b] DataStructures v0.17.19
  [e2d170a0] DataValueInterfaces v1.0.0
  [e7dc6d0d] DataValues v0.4.13
  [163ba53b] DiffResults v1.0.2
  [b552c78f] DiffRules v1.0.1
  [b4f34e82] Distances v0.9.0
  [31c24e10] Distributions v0.23.4
  [ced4e74d] DistributionsAD v0.5.3
  [ffbed154] DocStringExtensions v0.8.2
  [366bfd00] DynamicPPL v0.8.2
  [da5c29d0] EllipsisNotation v0.4.0
  [cad2338a] EllipticalSliceSampling v0.2.2
  [c87230d0] FFMPEG v0.3.0
  [b22a6f82] FFMPEG_jll v4.1.0+3
  [7a1cc6ca] FFTW v1.2.2
  [f5851436] FFTW_jll v3.3.9+5
  [1a297f60] FillArrays v0.8.11
  [6a86dc24] FiniteDiff v2.3.2
  [53c48c17] FixedPointNumbers v0.8.1
  [59287772] Formatting v0.4.1
  [f6369f11] ForwardDiff v0.10.11
  [d7e528f0] FreeType2_jll v2.10.1+2
  [559328eb] FriBidi_jll v1.0.5+3
  [28b8d3ca] GR v0.48.0
  [4d00f742] GeometryTypes v0.8.3
  [d25df0c9] Inflate v0.1.2
  [505f98c9] InplaceOps v0.3.0
  [1d5cc7b8] IntelOpenMP_jll v2018.0.3+0
  [a98d9a8b] Interpolations v0.12.10
  [8197267c] IntervalSets v0.5.1
  [41ab1584] InvertedIndices v1.0.0
  [c8e1da08] IterTools v1.3.0
  [82899510] IteratorInterfaceExtensions v1.0.0
  [682c06a0] JSON v0.21.0
  [5ab0869b] KernelDensity v0.5.1
  [c1c5ebd0] LAME_jll v3.100.0+1
  [1d6d02ad] LeftChildRightSiblingTrees v0.1.2
  [dd192d2f] LibVPX_jll v1.8.1+1
  [6f1fad26] Libtask v0.4.1
  [093fc24a] LightGraphs v1.3.3
  [d3d80556] LineSearches v7.0.1
  [6fdf6af0] LogDensityProblems v0.10.3
  [e6f89c97] LoggingExtras v0.4.1
  [c7f686f2] MCMCChains v3.0.12
  [856f044c] MKL_jll v2020.1.216+0
  [1914dd2f] MacroTools v0.5.5
  [dbb5928d] MappedArrays v0.2.2
  [442fdcdd] Measures v0.3.1
  [e1d29d7a] Missings v0.4.3
  [6f286f6a] MultivariateStats v0.7.0
  [d41bc354] NLSolversBase v7.6.1
  [872c559c] NNlib v0.6.6
  [77ba4419] NaNMath v0.3.3
  [86f7a689] NamedArrays v0.9.4
  [b8a86587] NearestNeighbors v0.4.6
  [510215fc] Observables v0.3.1
  [6fe1bfb0] OffsetArrays v1.1.0
  [e7412a2a] Ogg_jll v1.3.4+0
  [4536629a] OpenBLAS_jll v0.3.9+4
  [458c3c95] OpenSSL_jll v1.1.1+4
  [efe28fd5] OpenSpecFun_jll v0.5.3+3
  [429524aa] Optim v0.22.0
  [91d4177d] Opus_jll v1.3.1+1
  [bac558e1] OrderedCollections v1.2.0
  [90014a1f] PDMats v0.9.12
  [d96e819e] Parameters v0.12.1
  [69de0a69] Parsers v1.0.6
  [ccf2f8ad] PlotThemes v1.0.3
  [995b91a9] PlotUtils v0.6.5
  [91a5bcdd] Plots v0.29.9
  [2dfb63ee] PooledArrays v0.5.3
  [85a6dd25] PositiveFactorizations v0.2.3
  [33c8b6b6] ProgressLogging v0.1.3
  [92933f4c] ProgressMeter v1.3.1
  [1fd47b50] QuadGK v2.3.1
  [b3c3ace0] RangeArrays v0.3.2
  [c84ed2f1] Ratios v0.4.0
  [3cdcf5f2] RecipesBase v0.8.0
  [01d81517] RecipesPipeline v0.1.11
  [189a3867] Reexport v0.2.0
  [ae029012] Requires v1.0.1
  [79098fc4] Rmath v0.6.1
  [f50d1b31] Rmath_jll v0.2.2+1
  [f2b01f46] Roots v1.0.2
  [0aa819cd] SQLite v1.0.3
  [76ed43ae] SQLite_jll v3.31.1+0
  [992d4aef] Showoff v0.3.1
  [699a6c99] SimpleTraits v0.9.2
  [a2af1166] SortingAlgorithms v0.3.1
  [276daf66] SpecialFunctions v0.10.3
  [90137ffa] StaticArrays v0.12.3
  [2913bbd2] StatsBase v0.33.0
  [4c63d2b9] StatsFuns v0.9.5
  [f3b207a7] StatsPlots v0.14.6
  [ab02a1b2] TableOperations v0.2.1
  [3783bdb8] TableTraits v1.0.0
  [bd369af6] Tables v1.0.4
  [5d786b92] TerminalLoggers v0.1.2
  [9f7883ad] Tracker v0.2.7
  [84d833dd] TransformVariables v0.3.8
  [fce5fe82] Turing v0.13.0
  [3a884ed6] UnPack v1.0.1
  [ea10d353] WeakRefStrings v0.6.2
  [cc8bc4a8] Widgets v0.6.2
  [efce3f68] WoodburyMatrices v0.5.2
  [83775a58] Zlib_jll v1.2.11+14
  [700de1a5] ZygoteRules v0.2.0
  [0ac62f75] libass_jll v0.14.0+2
  [f638f0a6] libfdk_aac_jll v0.1.6+2
  [f27f6e37] libvorbis_jll v1.3.6+4
  [1270edf5] x264_jll v2019.5.25+2
  [dfaa095f] x265_jll v3.0.0+1
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8bb1440f] DelimitedFiles
  [8ba89e20] Distributed
  [9fa8497b] Future
  [b77e0a4c] InteractiveUtils
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [44cfe95a] Pkg
  [de0858da] Printf
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA
  [9e88b42a] Serialization
  [1a1011a3] SharedArrays
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics
  [4607b0f0] SuiteSparse
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode

(@v1.4) pkg>
marcoxa commented 4 years ago

Here is the final result of ] test Turing on the said Ubuntu machine.

Test Summary:                                                               | Pass  Error  Total
Turing                                                                      | 9930      7   9937
  core                                                                      |  245      2    247
    ad.jl                                                                   |  211      2    213
      adr                                                                   |    2             2
      passing duals to distributions                                        |    6             6
      general AD tests                                                      |    1      1      2
      Tracker, Zygote and ReverseDiff + logdet                              |    6             6
      Tracker & Zygote + fill                                               |   12            12
      Tracker, Zygote and ReverseDiff + MvNormal                            |    5             5
      Tracker, Zygote and ReverseDiff + Diagonal Normal                     |    5             5
      Tracker, Zygote and ReverseDiff + MvNormal Interface                  |  170           170
      Simplex Tracker, Zygote and ReverseDiff (with and without caching) AD |    2             2
      PDMatDistribution AD                                                  |           1      1
      Hessian test                                                          |    2             2
    container.jl                                                            |   34            34
  inference: forwarddiff                                                    | 3190      1   3191
    samplers                                                                | 3190      1   3191
      gibbs.jl                                                              |   24            24
      hmc.jl                                                                |   19      1     20
        constrained bounded                                                 |    1             1
        contrained simplex                                                  |    2             2
        hmc reverse diff                                                    |    2             2
        matrix support                                                      |           1      1
        multivariate support                                                |              No tests
        hmcda inference                                                     |    4             4
        hmcda constructor                                                   |    2             2
        nuts inference                                                      |    2             2
        nuts constructor                                                    |              No tests
        check discard                                                       |    2             2
        AHMC resize                                                         |    3             3
        Regression tests                                                    |    1             1
      is.jl                                                                 | 3002          3002
      mh.jl                                                                 |   26            26
      ESS                                                                   |   11            11
      SMC                                                                   |   25            25
      PG                                                                    |   35            35
      resample.jl                                                           |    5             5
      io.jl                                                                 |   41            41
      dynamichmc.jl                                                         |    2             2
  variational algorithms : forwarddiff                                      |    6             6
  inference: tracker                                                        | 3190      1   3191
    samplers                                                                | 3190      1   3191
      gibbs.jl                                                              |   24            24
      hmc.jl                                                                |   19      1     20
        constrained bounded                                                 |    1             1
        contrained simplex                                                  |    2             2
        hmc reverse diff                                                    |    2             2
        matrix support                                                      |           1      1
        multivariate support                                                |              No tests
        hmcda inference                                                     |    4             4
        hmcda constructor                                                   |    2             2
        nuts inference                                                      |    2             2
        nuts constructor                                                    |              No tests
        check discard                                                       |    2             2
        AHMC resize                                                         |    3             3
        Regression tests                                                    |    1             1
      is.jl                                                                 | 3002          3002
      mh.jl                                                                 |   26            26
      ESS                                                                   |   11            11
      SMC                                                                   |   25            25
      PG                                                                    |   35            35
      resample.jl                                                           |    5             5
      io.jl                                                                 |   41            41
      dynamichmc.jl                                                         |    2             2
  variational algorithms : tracker                                          |    6             6
  inference: reversediff                                                    | 3190      1   3191
    samplers                                                                | 3190      1   3191
      gibbs.jl                                                              |   24            24
      hmc.jl                                                                |   19      1     20
        constrained bounded                                                 |    1             1
        contrained simplex                                                  |    2             2
        hmc reverse diff                                                    |    2             2
        matrix support                                                      |           1      1
        multivariate support                                                |              No tests
        hmcda inference                                                     |    4             4
        hmcda constructor                                                   |    2             2
        nuts inference                                                      |    2             2
        nuts constructor                                                    |              No tests
        check discard                                                       |    2             2
        AHMC resize                                                         |    3             3
        Regression tests                                                    |    1             1
      is.jl                                                                 | 3002          3002
      mh.jl                                                                 |   26            26
      ESS                                                                   |   11            11
      SMC                                                                   |   25            25
      PG                                                                    |   35            35
      resample.jl                                                           |    5             5
      io.jl                                                                 |   41            41
      dynamichmc.jl                                                         |    2             2
  variational algorithms : reversediff                                      |    6             6
  variational optimisers                                                    |    8             8
  stdlib                                                                    |   70      2     72
    distributions.jl                                                        |   68      2     70
      distributions functions                                               |    1             1
      distributions functions                                               |    1             1
      distributions functions                                               |    1             1
      single distribution correctness                                       |   65      2     67
        Correctness test for single distributions                           |   65      2     67
          UnivariateDistribution                                            |   59            59
          MultivariateDistribution                                          |    6             6
          MatrixDistribution                                                |           2      2
            Wishart{Float64,PDMat{Float64,Array{Float64,2}},Int64}          |           1      1
            InverseWishart{Float64,PDMat{Float64,Array{Float64,2}}}         |           1      1
    RandomMeasures.jl                                                       |    2             2
  utilities                                                                 |    1             1
  modes                                                                     |   18            18
ERROR: LoadError: Some tests did not pass: 9930 passed, 0 failed, 7 errored, 0 broken.
in expression starting at /home/marco/.julia/packages/Turing/GMBTf/test/runtests.jl:12
ERROR: Package Turing errored during testing

(@v1.4) pkg>
devmotion commented 4 years ago

OK, so the Turing test errors are unrelated and already fixed on the master branch. They are caused by some breaking changes in Distributions 0.2.23, hence they should be gone if you downgrade Distributions to 0.2.22 by running ] add Distributions@0.2.22.

I assume the problems that you experience when running the quick start examples are caused by the quite old version of Plots that you use. The latest release is 1.4.4 whereas you use 0.29.9, I guess this causes problems together with the latest release of StatsPlots (0.14.6). Can you try to upgrade plots to the latest release by running ] add Plots@1.4.4? It should display an error message that tells you which package is holding it back, if the update is not possible.

marcoxa commented 4 years ago

Thanks for the advice.

I will try all of this tomorrow.

All the best

Marco

On Mon, Jun 29, 2020 at 7:18 PM David Widmann notifications@github.com wrote:

OK, so the Turing test errors are unrelated and already fixed on the master branch. They are caused by some breaking changes in Distributions 0.2.23, hence they should be gone if you downgrade Distributions to 0.2.22 by running ] add Distributions@0.2.22.

I assume the problems that you experience when running the quick start examples are caused by the quite old version of Plots that you use. The latest release is 1.4.4 whereas you use 0.29.9, I guess this causes problems together with the latest release of StatsPlots (0.14.6). Can you try to upgrade plots to the latest release by running ] add Plots@1.4.4? It should display an error message that tells you which package is holding it back, if the update is not possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TuringLang/Turing.jl/issues/1339#issuecomment-651252923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD5SWVAYGTHWVIKJ6TSOB3RZDEG3ANCNFSM4OLKKGJQ .

-- Marco Antoniotti Somewhere over the Rainbow

marcoxa commented 4 years ago

Hi

after a few updates, I can report that the first example works on my Linux/Ubuntu machine. The issue was the outdated Plots package.

All the best

Marco

On Mon, Jun 29, 2020 at 7:18 PM David Widmann notifications@github.com wrote:

OK, so the Turing test errors are unrelated and already fixed on the master branch. They are caused by some breaking changes in Distributions 0.2.23, hence they should be gone if you downgrade Distributions to 0.2.22 by running ] add Distributions@0.2.22.

I assume the problems that you experience when running the quick start examples are caused by the quite old version of Plots that you use. The latest release is 1.4.4 whereas you use 0.29.9, I guess this causes problems together with the latest release of StatsPlots (0.14.6). Can you try to upgrade plots to the latest release by running ] add Plots@1.4.4? It should display an error message that tells you which package is holding it back, if the update is not possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TuringLang/Turing.jl/issues/1339#issuecomment-651252923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD5SWVAYGTHWVIKJ6TSOB3RZDEG3ANCNFSM4OLKKGJQ .

-- Marco Antoniotti Somewhere over the Rainbow

devmotion commented 4 years ago

Great to hear that it works now! I'll close this issue then.