malmaud / TensorFlow.jl

A Julia wrapper for TensorFlow
Other
884 stars 109 forks source link

sefault on julia 1.3-rc5 #514

Open baggepinnen opened 4 years ago

baggepinnen commented 4 years ago

If you are making a bug report, please copy and paste the output of the following Julia snippit into the issue:

using TensorFlow
tf_versioninfo()

a = Variable(randn(2,2))
t = sum(a)

sess = Session()
run(sess, global_variables_initializer())

signal (11): Segmentation fault
in expression starting at none:0
TF_GraphGetTensorNumDims at /home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/../deps/usr/bin/libtensorflow.so (unknown line)
get_tensor_num_dims at /home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/core.jl:25
get_shape at /home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/core.jl:1826
show at /home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/show.jl:50
show at ./multimedia.jl:47 [inlined]
#34 at /home/fredrikb/.julia/packages/Atom/lBERI/src/display/display.jl:17
_jl_invoke at /home/fredrikb/julia/src/gf.c:2141 [inlined]
jl_apply_generic at /home/fredrikb/julia/src/gf.c:2305
#sprint#337 at ./strings/io.jl:105
sprint at ./strings/io.jl:101 [inlined]
render at /home/fredrikb/.julia/packages/Atom/lBERI/src/display/display.jl:16 [inlined]
Copyable at /home/fredrikb/.julia/packages/Juno/oLB1d/src/types.jl:39 [inlined]
Copyable at /home/fredrikb/.julia/packages/Juno/oLB1d/src/types.jl:40 [inlined]
render at /home/fredrikb/.julia/packages/Atom/lBERI/src/display/display.jl:19 [inlined]
render′ at /home/fredrikb/.julia/packages/Atom/lBERI/src/display/errors.jl:119
displayandrender at /home/fredrikb/.julia/packages/Atom/lBERI/src/display/showdisplay.jl:137
_jl_invoke at /home/fredrikb/julia/src/gf.c:2141 [inlined]
jl_apply_generic at /home/fredrikb/julia/src/gf.c:2305
#128 at /home/fredrikb/.julia/packages/Atom/lBERI/src/eval.jl:110
_jl_invoke at /home/fredrikb/julia/src/gf.c:2135 [inlined]
jl_apply_generic at /home/fredrikb/julia/src/gf.c:2305
jl_apply at /home/fredrikb/julia/src/julia.h:1631 [inlined]
jl_f__apply at /home/fredrikb/julia/src/builtins.c:627
jl_f__apply_latest at /home/fredrikb/julia/src/builtins.c:665
macro expansion at ./essentials.jl:709 [inlined]
#124 at /home/fredrikb/.julia/packages/Atom/lBERI/src/eval.jl:86
_jl_invoke at /home/fredrikb/julia/src/gf.c:2135 [inlined]
jl_apply_generic at /home/fredrikb/julia/src/gf.c:2305
handlemsg at /home/fredrikb/.julia/packages/Atom/lBERI/src/comm.jl:164
unknown function (ip: 0x7fecb8aaa86b)
_jl_invoke at /home/fredrikb/julia/src/gf.c:2135 [inlined]
jl_apply_generic at /home/fredrikb/julia/src/gf.c:2305
jl_apply at /home/fredrikb/julia/src/julia.h:1631 [inlined]
jl_f__apply at /home/fredrikb/julia/src/builtins.c:627
#19 at ./task.jl:333
unknown function (ip: 0x7fecb8aa45b7)
_jl_invoke at /home/fredrikb/julia/src/gf.c:2135 [inlined]
jl_apply_generic at /home/fredrikb/julia/src/gf.c:2305
jl_apply at /home/fredrikb/julia/src/julia.h:1631 [inlined]
start_task at /home/fredrikb/julia/src/task.c:659
unknown function (ip: 0xffffffffffffffff)
Allocations: 88453599 (Pool: 88433839; Big: 19760); GC: 90

Wording: Please copy-paste the entirely of the below output into any bug reports.
Note that this may display some errors, depending upon on your configuration. This is fine.

----------------
Library Versions
----------------
Trying to evaluate ENV["TF_USE_GPU"] but got error: KeyError("TF_USE_GPU")
Trying to evaluate ENV["LIBTENSORFLOW"] but got error: KeyError("LIBTENSORFLOW")

tf_version(kind=:backend) = 1.12.0
Trying to evaluate tf_version(kind=:python) but got error: RemoteException(2, CapturedException(LoadError("/home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/py.jl", 2, ArgumentError("Package MacroTools not found in current path:\n- Run `import Pkg; Pkg.add(\"MacroTools\")` to install the MacroTools package.\n")), Any[(require at loading.jl:887, 1), (include at boot.jl:328 [inlined], 1), (include_relative at loading.jl:1105, 1), (include at Base.jl:31, 1), (include at client.jl:424, 1), (#17 at TensorFlow.jl:160, 1), (#112 at process_messages.jl:309, 1), (run_work_thunk at process_messages.jl:79, 1), (run_work_thunk at process_messages.jl:88, 1), (#98 at task.jl:333, 1)]))
tf_version(kind=:julia) = 0.11.0

-------------
Python Status
-------------
PyCall.conda = false
ENV["PYTHON"] = python3
PyCall.PYTHONHOME = /usr:/usr
String(read(#= /home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/version.jl:104 =# Core.@cmd("pip --version"))) = pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

String(read(#= /home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/version.jl:105 =# Core.@cmd("pip3 --version"))) = pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

------------
Julia Status
------------
Julia Version 1.3.0-rc5.1
Commit 36c4eb251e (2019-11-17 19:04 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4550U CPU @ 1.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Environment:
  JULIA_NUM_THREADS = 3
julia> 
oxinabox commented 4 years ago

This is probably not the root cause of your problem. But it will be a problem. The process we PyCall python TensorFlow is not getting it's environment activated for some reason.

CapturedException(LoadError("/home/fredrikb/.julia/packages/TensorFlow/q9pY2/src/py.jl", 2, ArgumentError("Package MacroTools not found in current path:\n- Runimport Pkg; Pkg.add(\"MacroTools\")to install the MacroTools package.\n")), Any[(require at loading.jl:887, 1), (include at boot.jl:328 [inlined], 1), (include_relative at loading.jl:1105, 1), (include at Base.jl:31, 1), (include at client.jl:424, 1), (#17 at TensorFlow.jl:160, 1), (#112 at process_messages.jl:309, 1), (run_work_thunk at process_messages.jl:79, 1), (run_work_thunk at process_messages.jl:88, 1), (#98 at task.jl:333, 1)]))

That will prevent gradients working. But you get a segfault without calling gradients.

Anyway, though that does obsure your python TensorFlow version from that message. I see you are not using Conda.jl So it could be your python TensorFlow Version is not equal to the C LibTensprFliw version (1.12) which definitely causes segfaults.

But I am not sure you get up to having a python TensorFlow loaded.