# TensorFlow.jl basic usage ERROR: UndefVarError: global\_variables\_initializer not defined

**URL:** <https://discourse.julialang.org/t/tensorflow-jl-basic-usage-error-undefvarerror-global-variables-initializer-not-defined/2951>\
**Category:** Machine Learning\
**Tags:** package, tensorflow\
**Created:** [March 29, 2017, 3:18pm UTC](https://discourse.julialang.org/t/tensorflow-jl-basic-usage-error-undefvarerror-global-variables-initializer-not-defined/2951 "2017-03-29T15:18:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hpoit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hpoit/32/245_2.png) [@hpoit](https://discourse.julialang.org/u/hpoit)\
**Post date:** [March 29, 2017, 3:18pm UTC](https://discourse.julialang.org/t/tensorflow-jl-basic-usage-error-undefvarerror-global-variables-initializer-not-defined/2951/1 "2017-03-29T15:18:48Z")

</div>

```julia
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

---

<div class="post-metadata">

**Author:** ![malmaud](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/malmaud/32/29_2.png) [@malmaud](https://discourse.julialang.org/u/malmaud)\
**Post date:** [March 29, 2017, 3:43pm UTC](https://discourse.julialang.org/t/tensorflow-jl-basic-usage-error-undefvarerror-global-variables-initializer-not-defined/2951/2 "2017-03-29T15:43:23Z")

</div>

`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`.
