TuringLang / Turing.jl

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

Error precompiling Turing #1479

Closed sjwild closed 3 years ago

sjwild commented 3 years ago

I am having issues with Turing. When Turing precompiles, I get the following message:

julia> using Turing [ Info: Precompiling Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0] ERROR: LoadError: LoadError: syntax: unexpected semicolon in tuple around /Users/stephenwild/.julia/packages/Zygote/bdE6T/src/lib/lib.jl:30 Stacktrace: [1] top-level scope at /Users/stephenwild/.julia/packages/Zygote/bdE6T/src/lib/lib.jl:30 [2] include(::Function, ::Module, ::String) at ./Base.jl:380 [3] include at ./Base.jl:368 [inlined] [4] include(::String) at /Users/stephenwild/.julia/packages/Zygote/bdE6T/src/Zygote.jl:1 [5] top-level scope at /Users/stephenwild/.julia/packages/Zygote/bdE6T/src/Zygote.jl:31 [6] include(::Function, ::Module, ::String) at ./Base.jl:380 [7] include(::Module, ::String) at ./Base.jl:368 [8] top-level scope at none:2 [9] eval at ./boot.jl:331 [inlined] [10] eval(::Expr) at ./client.jl:467 [11] top-level scope at ./none:3 in expression starting at /Users/stephenwild/.julia/packages/Zygote/bdE6T/src/lib/lib.jl:30 in expression starting at /Users/stephenwild/.julia/packages/Zygote/bdE6T/src/Zygote.jl:31 ERROR: LoadError: LoadError: Failed to precompile Zygote [e88e6eb3-aa80-5325-afca-941959d7151f] to /Users/stephenwild/.julia/compiled/v1.5/Zygote/4kbLI_cjrnp.ji. Stacktrace: [1] error(::String) at ./error.jl:33 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305 [3] _require(::Base.PkgId) at ./loading.jl:1030 [4] require(::Base.PkgId) at ./loading.jl:928 [5] require(::Module, ::Symbol) at ./loading.jl:923 [6] include(::Function, ::Module, ::String) at ./Base.jl:380 [7] include at ./Base.jl:368 [inlined] [8] include(::String) at /Users/stephenwild/.julia/packages/Turing/r0coO/src/Turing.jl:1 [9] top-level scope at /Users/stephenwild/.julia/packages/Turing/r0coO/src/Turing.jl:126 [10] include(::Function, ::Module, ::String) at ./Base.jl:380 [11] include(::Module, ::String) at ./Base.jl:368 [12] top-level scope at none:2 [13] eval at ./boot.jl:331 [inlined] [14] eval(::Expr) at ./client.jl:467 [15] top-level scope at ./none:3 in expression starting at /Users/stephenwild/.julia/packages/Turing/r0coO/src/core/Core.jl:9 in expression starting at /Users/stephenwild/.julia/packages/Turing/r0coO/src/Turing.jl:126 ERROR: Failed to precompile Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0] to /Users/stephenwild/.julia/compiled/v1.5/Turing/gm4QC_cjrnp.ji. Stacktrace: [1] error(::String) at ./error.jl:33 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305 [3] _require(::Base.PkgId) at ./loading.jl:1030 [4] require(::Base.PkgId) at ./loading.jl:928 [5] require(::Module, ::Symbol) at ./loading.jl:923

I have tried some of the solutions from other relate issues, including updating the packages (both Turing and Zygote) and adding the packages again. I used Turing last week and had no issues.

Thanks.

devmotion commented 3 years ago

Can you post the output of

] st --manifest

in the Julia REPL?

sjwild commented 3 years ago

Here you go. Watch it be a simple solution :-p

(@v1.5) pkg> st --manifest Status ~/.julia/environments/v1.5/Manifest.toml [621f4979] AbstractFFTs v0.4.1 [1520ce14] AbstractTrees v0.2.1 [79e6a3ab] Adapt v1.1.0 [0bf59076] AdvancedHMC v0.2.26 [dce04be8] ArgCheck v1.1.0 [7d9fca2a] Arpack v0.4.0 [68821587] Arpack_jll v3.5.0+3 [4fba245c] ArrayInterface v2.14.2 [56f22d72] Artifacts v1.3.0 [bf4720bc] AssetRegistry v0.1.0 [c52e3926] Atom v0.11.3 [13072b0f] AxisAlgorithms v1.0.0 [39de3d68] AxisArrays v0.3.3 [6e4b80f9] BenchmarkTools v0.4.3 [76274a88] Bijectors v0.4.0 [9e28174c] BinDeps v1.0.2 [b99e7846] BinaryProvider v0.5.10 [8e7c35d0] BlockArrays v0.11.2 [0a1fb500] BlockDiagonals v0.1.6 [6e34b625] Bzip2_jll v1.0.6+5 [fa961155] CEnum v0.4.1 [00ebfdb7] CSTParser v0.6.2 [336ed68f] CSV v0.5.23 [3895d2a7] CUDAapi v1.2.0 [c5f51814] CUDAdrv v3.1.0 [be33ccc6] CUDAnative v2.4.0 [49dc2e85] Calculus v0.5.1 [7057c7e9] Cassette v0.3.3 [aafaddc9] CatIndices v0.2.1 [324d7699] CategoricalArrays v0.7.7 [d360d2e6] ChainRulesCore v0.9.20 [aaaa29a8] Clustering v0.13.5 [53a63b46] CodeTools v0.6.5 [da1fd8a2] CodeTracking v0.5.12 [523fee87] CodecBzip2 v0.7.2 [944b1d66] CodecZlib v0.6.0 [3da002f7] ColorTypes v0.8.1 [c3611d14] ColorVectorSpace v0.8.7 [5ae59095] Colors v0.9.6 [861a8166] Combinatorics v0.7.0 [bbf7d656] CommonSubexpressions v0.3.0 [34da2185] Compat v2.2.1 [e66e0078] CompilerSupportLibraries_jll v0.3.4+0 [a81c6b42] Compose v0.8.2 [ed09eef8] ComputationalResources v0.3.2 [8f4d0f93] Conda v1.5.0 [d38c429a] Contour v0.5.6 [150eb455] CoordinateTransformations v0.6.1 [7ad07ef1] CoupledFields v0.1.0 [3a865a2d] CuArrays v1.2.1 [dc8bdbbb] CustomUnitRanges v1.0.0 [75c7ada1] DBFTables v0.2.2 [717857b8] DSP v0.6.0 [9a962f9c] DataAPI v1.4.0 [a93c6f00] DataFrames v0.19.4 [1313f7d8] DataFramesMeta v0.5.0 [864edb3b] DataStructures v0.17.20 [e2d170a0] DataValueInterfaces v1.0.0 [e7dc6d0d] DataValues v0.4.13 [85a47980] Dictionaries v0.3.5 [01453d9d] DiffEqDiffTools v1.7.0 [163ba53b] DiffResults v0.0.4 [b552c78f] DiffRules v0.1.0 [b4f34e82] Distances v0.8.2 [31c24e10] Distributions v0.21.9 [ced4e74d] DistributionsAD v0.1.1 [33d173f1] DocSeeker v0.3.2 [ffbed154] DocStringExtensions v0.8.3 [e30172f5] Documenter v0.25.5 [bbc10e6e] DynamicHMC v2.2.0 [e2ba6199] ExprTools v0.1.3 [8f5d6c58] EzXML v1.1.0 [c87230d0] FFMPEG v0.2.4 [4f61f5a4] FFTViews v0.3.1 [7a1cc6ca] FFTW v1.0.1 [5789e2e9] FileIO v1.4.4 [48062228] FilePathsBase v0.7.0 [1a297f60] FillArrays v0.7.4 [26cc04aa] FiniteDifferences v0.10.9 [53c48c17] FixedPointNumbers v0.6.1 [587475ba] Flux v0.9.0 [f6369f11] ForwardDiff v0.10.14 [de31a74c] FunctionalCollections v0.5.0 [38e38edf] GLM v1.3.11 [0c68f7d7] GPUArrays v1.0.4 [28b8d3ca] GR v0.44.0 [c91e804a] Gadfly v1.2.1 [cf35fbd7] GeoInterface v0.5.4 [4d00f742] GeometryTypes v0.7.10 [a2bd30eb] Graphics v1.0.2 [42e2da0e] Grisu v1.0.0 [cd3eb016] HTTP v0.8.19 [a1b4810d] Hexagons v0.2.0 [9fb69e20] Hiccup v0.2.2 [7073ff75] IJulia v1.23.0 [b5f81e59] IOCapture v0.1.1 [7869d1d1] IRTools v0.2.3 [bbac6d45] IdentityRanges v0.3.1 [2803e5a7] ImageAxes v0.6.7 [f332f351] ImageContrastAdjustment v0.3.6 [a09fc81d] ImageCore v0.8.19 [51556ac3] ImageDistances v0.2.9 [6a3955dd] ImageFiltering v0.6.17 [82e4d734] ImageIO v0.4.0 [6218d12a] ImageMagick v1.1.6 [c73af94c] ImageMagick_jll v6.9.10-12+3 [bc367c6b] ImageMetadata v0.9.4 [787d08f9] ImageMorphology v0.2.9 [2996bd0c] ImageQualityIndexes v0.2.0 [4e3cecfd] ImageShow v0.2.3 [02fcd773] ImageTransformations v0.8.6 [916415d5] Images v0.23.1 [313cdc1a] Indexing v1.1.0 [9b13fd28] IndirectArrays v0.5.1 [83e8ac13] IniFile v0.5.0 [505f98c9] InplaceOps v0.3.0 [43edad99] InstantiateFromURL v0.5.0 [a98d9a8b] Interpolations v0.12.10 [8197267c] IntervalSets v0.3.2 [41ab1584] InvertedIndices v1.0.0 [c8e1da08] IterTools v1.3.0 [82899510] IteratorInterfaceExtensions v1.0.0 [692b3bcd] JLLWrappers v1.1.3 [682c06a0] JSON v0.21.1 [7d188eb4] JSONSchema v0.3.3 [494afd89] JavaCall v0.7.6 [aacddb02] JpegTurbo_jll v2.0.1+3 [98e50ef6] JuliaFormatter v0.1.19 [aa1ae85d] JuliaInterpreter v0.7.26 [e5e0dc1b] Juno v0.7.2 [5ab0869b] KernelDensity v0.5.1 [929cbde3] LLVM v1.7.0 [7c4cb9fa] LNR v0.2.1 [38d8eb38] Lathe v0.0.9 [50d2b5c4] Lazy v0.14.0 [7f8f8fb0] LearnBase v0.2.2 [94ce4f54] Libiconv_jll v1.16.0+7 [6f1fad26] Libtask v0.3.4 [89763e89] Libtiff_jll v4.1.0+2 [d3d80556] LineSearches v7.1.0 [4345ca2d] Loess v0.5.2 [6fdf6af0] LogDensityProblems v0.9.2 [2fda8390] LsqFit v0.11.0 [c7f686f2] MCMCChains v0.3.15 [f0e99cf1] MLBase v0.8.0 [9920b226] MLDataPattern v0.5.4 [cc2ba9b6] MLDataUtils v0.5.2 [66a33bbf] MLLabelUtils v0.5.5 [1914dd2f] MacroTools v0.5.6 [dbb5928d] MappedArrays v0.2.2 [b8f27783] MathOptInterface v0.9.18 [fdba3010] MathProgBase v0.7.8 [739be429] MbedTLS v1.0.3 [c8ffd9c3] MbedTLS_jll v2.16.8+1 [442fdcdd] Measures v0.3.1 [e89f7d12] Media v0.5.0 [e1d29d7a] Missings v0.4.4 [ff71e718] MixedModels v2.4.0 [78c3b35d] Mocking v0.7.1 [e94cdb99] MosaicViews v0.2.4 [99f44e22] MsgPack v1.1.0 [46d2c3a1] MuladdMacro v0.2.2 [6f286f6a] MultivariateStats v0.8.0 [d8a4904e] MutableArithmetics v0.2.12 [d41bc354] NLSolversBase v7.5.0 [76087f3c] NLopt v0.6.1 [079eb43e] NLopt_jll v2.7.0+0 [872c559c] NNlib v0.6.6 [77ba4419] NaNMath v0.3.5 [86f7a689] NamedArrays v0.9.4 [b8a86587] NearestNeighbors v0.4.4 [f09324ee] Netpbm v1.0.0 [510215fc] Observables v0.2.3 [6fe1bfb0] OffsetArrays v1.3.1 [4536629a] OpenBLAS_jll v0.3.9+5 [429524aa] Optim v0.20.1 [87e2bd06] OptimBase v2.0.1 [bac558e1] OrderedCollections v1.3.2 [90014a1f] PDMats v0.9.12 [f57f5aa1] PNGFiles v0.3.2 [5432bcbf] PaddedViews v0.5.7 [d96e819e] Parameters v0.12.1 [69de0a69] Parsers v0.3.12 [fa939f87] Pidfile v1.2.0 [ccf2f8ad] PlotThemes v1.0.3 [995b91a9] PlotUtils v0.6.5 [91a5bcdd] Plots v0.28.4 [c3e4b0f8] Pluto v0.12.7 [7f904dfe] PlutoUI v0.6.2 [f27b6e38] Polynomials v0.6.1 [2dfb63ee] PooledArrays v0.5.3 [85a6dd25] PositiveFactorizations v0.2.4 [92933f4c] ProgressMeter v1.4.0 [1fd47b50] QuadGK v2.4.1 [df47a6cb] RData v0.6.3 [ce6b1742] RDatasets v0.7.3 [b3c3ace0] RangeArrays v0.3.2 [c84ed2f1] Ratios v0.4.0 [3cdcf5f2] RecipesBase v0.7.0 [189a3867] Reexport v0.2.0 [ae029012] Requires v0.5.2 [79098fc4] Rmath v0.5.1 [f2b01f46] Roots v0.8.4 [6038ab10] Rotations v1.0.2 [8e980c4a] Shapefile v0.6.2 [1277b4bf] ShiftedArrays v1.0.0 [992d4aef] Showoff v0.3.2 [699a6c99] SimpleTraits v0.9.3 [b85f4697] SoftGlobalScope v1.1.0 [a2af1166] SortingAlgorithms v0.3.1 [276daf66] SpecialFunctions v0.8.0 [03a91e81] SplitApplyCombine v1.1.3 [90137ffa] StaticArrays v0.12.5 [2913bbd2] StatsBase v0.32.2 [4c63d2b9] StatsFuns v0.8.0 [3eaba693] StatsModels v0.6.14 [f3b207a7] StatsPlots v0.12.0 [88034a9c] StringDistances v0.4.0 [fd094767] Suppressor v0.1.1 [3783bdb8] TableTraits v1.0.0 [bd369af6] Tables v0.2.11 [61d0e4fa] Taro v0.8.3 [06e1c1a7] TiledIteration v0.2.5 [f269a46b] TimeZones v0.10.5 [a759f4b9] TimerOutputs v0.5.7 [0796e94c] Tokenize v0.5.8 [37b6cedf] Traceur v0.3.1 [9f7883ad] Tracker v0.2.12 [3bb67fe8] TranscodingStreams v0.9.5 [84d833dd] TransformVariables v0.3.10 [a2a6695c] TreeViews v0.3.0 [fce5fe82] Turing v0.7.3 [ead7e11d] TuringModels v1.0.0 [9d95f2ec] TypedTables v1.2.0 [30578b45] URIParser v0.4.1 [3a884ed6] UnPack v1.0.2 [81def892] VersionParsing v1.2.0 [ea10d353] WeakRefStrings v0.6.2 [0f1e0344] WebIO v0.8.15 [104b5d7c] WebSockets v1.5.2 [cc8bc4a8] Widgets v0.6.2 [1b915085] WinReg v0.3.1 [efce3f68] WoodburyMatrices v0.5.3 [02c8fc9c] XML2_jll v2.9.10+3 [c2297ded] ZMQ v1.2.1 [8f1865be] ZeroMQ_jll v4.3.2+5 [a5390f91] ZipFile v0.8.4 [83775a58] Zlib_jll v1.2.11+18 [3161d3a3] Zstd_jll v1.4.5+2 [e88e6eb3] Zygote v0.3.4 [700de1a5] ZygoteRules v0.1.0 [b53b4c65] libpng_jll v1.6.37+6 [2a0f44e3] Base64 [ade2ca70] Dates [8bb1440f] DelimitedFiles [8ba89e20] Distributed [7b1f6079] FileWatching [9fa8497b] Future [b77e0a4c] InteractiveUtils [76f85450] LibGit2 [8f399da3] Libdl [37e2e46d] LinearAlgebra [56ddb016] Logging [d6f4376e] Markdown [a63ad114] Mmap [44cfe95a] Pkg [de0858da] Printf [9abbd945] Profile [3fa0cd96] REPL [9a3f8284] Random [ea8e919c] SHA [9e88b42a] Serialization [1a1011a3] SharedArrays [6462fe0b] Sockets [2f01184e] SparseArrays [10745b16] Statistics [4607b0f0] SuiteSparse [8dfed614] Test [cf7118a7] UUIDs [4ec0a83e] Unicode

devmotion commented 3 years ago

Your Turing version

 [fce5fe82] Turing v0.7.3

is very old, the most recent version is 0.15.0 (and also Zygote is quite old, you use 0.3.4 but the latest release is 0.5.14). I assume that some other package holds Turing back or downgraded it. You can run

] add Turing@0.15

in the Julia REPL to see what other packages are problematic. If it worked some days ago, then maybe the different dependencies in Turing 0.15.0 are problematic. You can try to downgrade to Turing 0.14 by running

] add Turing@0.14
sjwild commented 3 years ago

Thanks. I managed to fix it so that Turing works. The last trick was quite helpful.

Steve

devmotion commented 3 years ago

Great to hear! I'll close this issue.