sergio-santos-group / ProtoSyn.jl

A Julia-based framework for molecular modelling
https://sergio-santos-group.github.io/ProtoSyn.jl/stable/
GNU Affero General Public License v3.0
58 stars 7 forks source link

Failure to import ProtoSyn #52

Closed jgreener64 closed 1 year ago

jgreener64 commented 1 year ago

With using ProtoSyn I get:

 | Loading TorchANI

β”Œ Warning: πŸ“ ProtoSyn was not able to identify `torchani` in this system.
β”‚ PyCall is currently configured to use the Python version at /home/jgreener/soft/miniconda3/bin/python3.
β”‚ In order to use the TorchANI energy function component, make sure to:
β”‚     - Set ENV["PYTHON"] to the path of python executable you wish to use, run Pkg.build("PyCall") and re-launch Julia and ProtoSyn.
β”‚     - Make sure `torchani` is installed in the machine trying to load ProtoSyn.
β”‚ 
β”‚ In order to install `torchani`, follow the following instructions:
β”‚ (1) Install TorchANI: pip install torchani
β”‚ (2) Re-launch Julia and ProtoSyn
β”‚ 
β”‚ ProtoSyn will continue loading, but the `Calculators.TorchANI` module will be unavailable.
β”‚ To surpress further warnings for unavailable energy function components, set the JULIA_PROTOSYN_WARN_NON_AVALIABLE_EFC environment flag and re-launch Julia and ProtoSyn. 
β”‚ $ export JULIA_PROTOSYN_WARN_NON_AVALIABLE_EFC=false
β”‚ Optionally, add the above line to ~/.bashrc to persistently supress warnings in further sessions.
β”‚ 
β”” @ ProtoSyn.Calculators.TorchANI ~/.julia/packages/ProtoSyn/2L4hi/src/Core/Calculators/torchani.jl:57
 | Loading ONNX models
ERROR: InitError: MethodError: Cannot `convert` an object of type 
  Umlaut.Tape{ONNX.ONNXCtx} to an object of type 
  Ghost.Tape
Closest candidates are:
  convert(::Type{T}, ::T) where T at Base.jl:61
  Ghost.Tape(::C) where C at ~/.julia/packages/Ghost/WYs14/src/tape.jl:220
Stacktrace:
  [1] convert(#unused#::Type{Union{Nothing, Ghost.Tape}}, x::Umlaut.Tape{ONNX.ONNXCtx})
    @ Base ./some.jl:36
  [2] ProtoSyn.Calculators.GB.GBModels(C::Umlaut.Tape{ONNX.ONNXCtx}, N::Umlaut.Tape{ONNX.ONNXCtx}, H::Umlaut.Tape{ONNX.ONNXCtx}, O::Umlaut.Tape{ONNX.ONNXCtx}, S::Umlaut.Tape{ONNX.ONNXCtx})
    @ ProtoSyn.Calculators.GB ~/.julia/packages/ProtoSyn/2L4hi/src/Core/Calculators/gb.jl:9
  [3] top-level scope
    @ none:1
  [4] eval
    @ ./boot.jl:368 [inlined]
  [5] __init__()
    @ ProtoSyn.Calculators.GB ~/.julia/packages/ProtoSyn/2L4hi/src/Core/Calculators/gb.jl:21
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
    @ Base ./loading.jl:831
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
    @ Base ./loading.jl:1039
  [8] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1315
  [9] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1200
 [10] macro expansion
    @ ./loading.jl:1180 [inlined]
 [11] macro expansion
    @ ./lock.jl:223 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144
during initialization of module GB

This also seems to affect the Travis build: https://app.travis-ci.com/github/sergio-santos-group/ProtoSyn.jl

I am on Julia 1.8.5 and my packages are:

βŒƒ [21141c5a] AMDGPU v0.4.5
  [4c88cf16] Aqua v0.6.0
  [a9b6321e] Atomix v0.1.0
  [a963bdd2] AtomsBase v0.2.5 `~/.julia/dev/AtomsBase`
  [fbb218c0] BSON v0.3.6
  [6e4b80f9] BenchmarkTools v1.3.2
  [99c8bb3a] Bio3DView v0.1.4 `~/.julia/dev/Bio3DView`
  [00701ae9] BioAlignments v3.1.0
  [37cfa864] BioCore v2.0.5
  [7e6ae17a] BioSequences v3.1.3
  [de9282ab] BioStructures v2.0.0 `~/.julia/dev/BioStructures`
  [052768ef] CUDA v4.0.0 `~/.julia/dev/CUDA`
  [13f3f980] CairoMakie v0.10.2
  [69e1c6dd] CellListMap v0.8.14
  [082447d4] ChainRules v1.48.0 `~/.julia/dev/ChainRules`
  [d360d2e6] ChainRulesCore v1.15.7
βŒƒ [46823bd8] Chemfiles v0.10.3
  [944b1d66] CodecZlib v0.7.1
  [5ae59095] Colors v0.12.10
βŒƒ [f68482b8] Cthulhu v2.8.5
  [a93c6f00] DataFrames v1.5.0
  [31c24e10] Distributions v0.25.86
  [35a29f4d] DocumenterTools v0.1.16
  [7da242da] Enzyme v0.11.0-dev `~/.julia/dev/Enzyme`
  [f151be2c] EnzymeCore v0.2.1 `~/.julia/dev/Enzyme/lib/EnzymeCore`
  [8f5d6c58] EzXML v1.1.0
  [5789e2e9] FileIO v1.16.0
  [26cc04aa] FiniteDifferences v0.12.26
  [587475ba] Flux v0.13.14
  [1fa38f19] Format v1.3.2
  [f6369f11] ForwardDiff v0.10.35
  [e9467ef8] GLMakie v0.8.2
  [86223c79] Graphs v1.8.0
  [f67ccb44] HDF5 v0.16.14
  [7073ff75] IJulia v1.24.0
βŒƒ [c3a54625] JET v0.7.8
  [682c06a0] JSON v0.21.3
  [63c18a36] KernelAbstractions v0.9.0
  [259c3a9c] MMTF v1.0.0 `~/.julia/dev/MMTF`
  [ee78f7c6] Makie v0.19.2
  [626554b9] MetaGraphs v0.7.2
  [6c89ec66] MolecularGraph v0.13.0
  [aa0f7f06] Molly v0.14.3 `~/.julia/dev/Molly`
βŒƒ [5fb14364] OhMyREPL v0.5.17
  [29c4880b] OpenSMILES v0.1.0
  [3bd65402] Optimisers v0.2.15
  [32113eaa] PkgBenchmark v0.2.12
βŒƒ [91a5bcdd] Plots v1.38.7
  [c46f51b8] ProfileView v1.7.0
  [186d2b2d] ProteinEnsembles v0.3.1 `~/.julia/dev/ProteinEnsembles`
  [c9758760] ProtoSyn v0.4.0 `https://github.com/sergio-santos-group/ProtoSyn.jl.git#master`
  [44044271] RDKitMinimalLib v1.2.0
  [3cdcf5f2] RecipesBase v1.3.3
  [295af30f] Revise v3.5.1
  [de6bee2f] SimpleChains v0.4.3
βŒ… [90137ffa] StaticArrays v1.5.17
  [f3b207a7] StatsPlots v0.15.4
  [1986cc42] Unitful v1.12.4
  [f31437dd] UnitfulChainRules v0.1.2
  [013be700] UnsafeAtomics v0.2.1
  [d80eeb9a] UnsafeAtomicsLLVM v0.1.0
  [e88e6eb3] Zygote v0.6.57 `~/.julia/dev/Zygote`
  [7cc45869] Enzyme_jll v0.0.51+0 `~/.julia/dev/Enzyme_jll`
mfherbst commented 1 year ago

I can reproduce the issue and get a similar stacktrace.

JosePereiraUA commented 1 year ago

I'll take a look at this issue now.

JosePereiraUA commented 1 year ago

The dev branch was working ok, I just forgot to merge the changes to the master branch. Commit https://github.com/sergio-santos-group/ProtoSyn.jl/commit/4a201aa23a77c4297bfc9813ef8b9a59797643f4 fixes this, the current master branch should import just fine. Let me know if you still have troubles.

jgreener64 commented 1 year ago

Works for me.