TensorFlow.jl basic usage ERROR: UndefVarError: global_variables_initializer not defined

julia> using TensorFlow
INFO: Precompiling module TensorFlow.

julia> sess=TensorFlow.Session()
2017-03-29 12:11:27.483376: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-03-29 12:11:27.483427: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
Session(Ptr{Void} @0x0000000115d7df70)

julia> x = TensorFlow.constant(Float64[1,2])
<Tensor Const:1 shape=(2) dtype=Float64>

julia> y = TensorFlow.Variable(Float64[3,4])
TensorFlow.Variable(<Operation 'node'>,<Operation 'node/Assign'>)

julia> z = TensorFlow.placeholder(Float64)
<Tensor placeholder:1 shape=unknown dtype=Float64>

julia> w = exp(x + z + -y)
<Tensor Exp:1 shape=unknown dtype=Float64>

julia> run(sess, TensorFlow.global_variables_initializer())
ERROR: UndefVarError: global_variables_initializer not defined

julia> 

@malmaud would appreciate your help Jon

global_variables_initializer is not on a tagged version of TensorFlow.jl yet (it’s called initialize_all_variables on the tagged version).

Pkg.checkout("TensorFlow") will get you a version with global_variables_initializer.

2 Likes