Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logistic Regression example does not run in Docker container #439

Open
metanoid opened this issue Sep 23, 2018 · 5 comments
Open

Logistic Regression example does not run in Docker container #439

metanoid opened this issue Sep 23, 2018 · 5 comments

Comments

@metanoid
Copy link

I used commit 05ea5a6 to install Julia 1.0.0 and TensorFlow in a Docker container. Then I tried running the "Logistic Regression" example in the resulting terminal.

  • First problem: User needs to explicitly add, build, and using PyCall to get rid of messages complaining of PyCall being missing
  • Second Problem: py_gradients not defined (See error log at bottom of issue)
----------------
Library Versions
----------------
$(Expr(:escape, :(ENV["TF_USE_GPU"]))) = "0"
Trying to evaluate ENV["LIBTENSORFLOW"] but got error: KeyError("LIBTENSORFLOW")

$(Expr(:escape, :(tf_version(kind=:backend)))) = v"1.10.0"
Trying to evaluate tf_version(kind=:python) but got error: RemoteException(2, CapturedException(UndefVarError(:py_tf), Any[(#13 at TensorFlow.jl:181, 1), (#116 at process_messages.jl:276, 1), (run_work_thunk at process_messages.jl:56, 1), (run_work_thunk at process_messages.jl:65, 1), (#102 at task.jl:259, 1)]))
$(Expr(:escape, :(tf_version(kind=:julia)))) = v"0.10.1+"

-------------
Python Status
-------------
$(Expr(:escape, :(PyCall.conda))) = false
$(Expr(:escape, :(ENV["PYTHON"]))) = "/usr/bin/python"
$(Expr(:escape, :(PyCall.PYTHONHOME))) = "/usr:/usr"
Trying to evaluate readstring(#= /root/.julia/packages/TensorFlow/W6Dwj/src/version.jl:101 =# @cmd("pip --version")) but got error: UndefVarError(:readstring)
Trying to evaluate readstring(#= /root/.julia/packages/TensorFlow/W6Dwj/src/version.jl:102 =# @cmd("pip3 --version")) but got error: UndefVarError(:readstring)

------------
Julia Status
------------
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
julia> minimize_op = train.minimize(optimizer, Loss)
ERROR: On worker 2:
UndefVarError: py_gradients not defined
#11 at /root/.julia/packages/TensorFlow/W6Dwj/src/TensorFlow.jl:181
#116 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Distributed/src/process_messages.jl:276
run_work_thunk at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Distributed/src/process_messages.jl:56
run_work_thunk at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Distributed/src/process_messages.jl:65
#102 at ./task.jl:259
Stacktrace:
 [1] #remotecall_wait#154(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Distributed.Worker) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:407
 [2] remotecall_wait(::Function, ::Distributed.Worker) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:398
 [3] #remotecall_wait#157(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Int64) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:419
 [4] remotecall_wait(::Function, ::Int64) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:419
 [5] top-level scope at /root/.julia/packages/TensorFlow/W6Dwj/src/TensorFlow.jl:180
 [6] eval at ./boot.jl:319 [inlined]
 [7] eval at ./sysimg.jl:68 [inlined]
 [8] add_gradients_py(::Tensor{Float64}, ::Array{Any,1}, ::Nothing) at /root/.julia/packages/TensorFlow/W6Dwj/src/core.jl:1545
 [9] gradients at /root/.julia/packages/TensorFlow/W6Dwj/src/core.jl:1533 [inlined] (repeats 2 times)
 [10] compute_gradients(::TensorFlow.train.AdamOptimizer, ::Tensor{Float64}, ::Nothing) at /root/.julia/packages/TensorFlow/W6Dwj/src/train.jl:49
 [11] #minimize#1(::Nothing, ::Nothing, ::Nothing, ::Function, ::TensorFlow.train.AdamOptimizer, ::Tensor{Float64}) at /root/.julia/packages/TensorFlow/W6Dwj/src/train.jl:41
 [12] minimize(::TensorFlow.train.AdamOptimizer, ::Tensor{Float64}) at /root/.julia/packages/TensorFlow/W6Dwj/src/train.jl:38
 [13] top-level scope at none:0
@malmaud
Copy link
Owner

malmaud commented Sep 24, 2018

I wonder if this is an upstream problem with the new package manager, since PyCall is clearly there in REQUIRES.

@NTimmons
Copy link

Currently getting this problem with py_gradients not defined when using TensorFlow with XLA

@oxinabox
Copy link
Collaborator

#493 will fix the need to manually install PyCall

@oxinabox
Copy link
Collaborator

Yes, missing PyCall is only one of the reasons a worker might be dying.
This is unfortunately not an easy one to debug.

@jackvice
Copy link

jackvice commented Feb 2, 2019

I am getting same:
UndefVarError: py_gradients not defined #9 at /home/jack/.julia/packages/TensorFlow/q9pY2/src/TensorFlow.jl:189
With Julia 1.1 and Tensorflow 1.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants