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

build TensorFlow Error #453

Closed
daxinnan opened this Issue Oct 22, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@daxinnan

daxinnan commented Oct 22, 2018

julia> ENV["PYTHON"]=""
""
julia> using Pkg

julia> Pkg.build("TensorFlow")
  Building Arpack ──────────→ `~/.julia/packages/Arpack/UiiMc/deps/build.log`
  Building SpecialFunctions → `~/.julia/packages/SpecialFunctions/sXbz6/deps/build.log`
  Building Rmath ───────────→ `~/.julia/packages/Rmath/Py9gH/deps/build.log`
  Building Conda ───────────→ `~/.julia/packages/Conda/uQitS/deps/build.log`
  Building MbedTLS ─────────→ `~/.julia/packages/MbedTLS/mkHpa/deps/build.log`
  Building PyCall ──────────→ `~/.julia/packages/PyCall/0jMpb/deps/build.log`
  Building CodecZlib ───────→ `~/.julia/packages/CodecZlib/wwgbh/deps/build.log`
  Building TensorFlow ──────→ `~/.julia/packages/TensorFlow/A6TdG/deps/build.log`
┌ Error: Error building `TensorFlow`:
│ Warning: 'conda-forge' already in 'channels' list, moving to the top
│ Solving environment: ...working... done
│
│ # All requested packages already installed.
│
│   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
│                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:06:01 --:--:--     0
│ curl: (56) TCP connection reset by peer
│ [ Info: Building TensorFlow.jl for CPU use only. To enable the GPU, set the TF_USE_GPU environment variable to 1 and rebuild TensorFlow.jl
│ [ Info: Running `conda config --add channels conda-forge --force` in root environment
│ [ Info: Running `conda install -y tensorflow=1.10.0` in root environment
│ ERROR: LoadError: failed process: Process(`curl -g -L -f -o /xxxxx/.julia/packages/TensorFlow/A6TdG/deps/downloads/tensorflow.tar.gz https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.10.0.tar.gz`, ProcessExited(56)) [56]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│  [2] pipeline_error at ./process.jl:705 [inlined]
│  [3] #run#504(::Bool, ::Function, ::Cmd) at ./process.jl:663
│  [4] run at ./process.jl:661 [inlined]
│  [5] download(::String, ::String) at ./download.jl:27
│  [6] download_and_unpack(::String) at /xxxxxx/.julia/packages/TensorFlow/A6TdG/deps/build.jl:78
│  [7] top-level scope at /xxxxxx/.julia/packages/TensorFlow/A6TdG/deps/build.jl:99
│  [8] include at ./boot.jl:317 [inlined]
│  [9] include_relative(::Module, ::String) at ./loading.jl:1041
│  [10] include(::Module, ::String) at ./sysimg.jl:29
│  [11] include(::String) at ./client.jl:388
│  [12] top-level scope at none:0
│ in expression starting at /xxxxxx/.julia/packages/TensorFlow/A6TdG/deps/build.jl:93
└ @ Pkg.Operations /xxxx/download/julia/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1069

The network is not so good,and I don't have enough permission to change anything. What can I do for this, is there any offline way to solve it?
I download tensorflow.tar.gz by curl -g -L -f -o /xx/tensorflow.tar.gz https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.10.0.tar.gz in another network environment and move the tarball to the required location, but it doesn't work.
my versioninfo is

julia> versioninfo()
Julia Version 1.0.1
Commit 0d713926f8* (2018-09-29 19:05 UTC)
Platform Info:
  OS: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)

@daxinnan daxinnan closed this Oct 22, 2018

@daxinnan daxinnan reopened this Oct 23, 2018

@daxinnan

This comment has been minimized.

daxinnan commented Oct 23, 2018

I don't know why github met a network error yesterday, I created two same issues and closed both of them..... What should I do?

@Roger-luo

This comment has been minimized.

Roger-luo commented Oct 23, 2018

It seems that you are blocked by GFW, this downloads TensorFlow from official google storage, which is not a valid address in mainland China.

https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.10.0.tar.gz

you can try to download this manually to /xxxxx/.julia/packages/TensorFlow/A6TdG/deps/downloads/tensorflow.tar.gz address with curl, and you will probably find a time out error.

@daxinnan

This comment has been minimized.

daxinnan commented Oct 23, 2018

It seems that you are blocked by GFW, this downloads TensorFlow from official google storage, which is not a valid address in mainland China.

https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.10.0.tar.gz

you can try to download this manually to /xxxxx/.julia/packages/TensorFlow/A6TdG/deps/downloads/tensorflow.tar.gz address with curl, and you will probably find a time out error.

I downloaded it successfully in another computer, and moved the tarball to the required location. However, the building error showed again, I was looking for one way to build tensorfow offline?
Thank you anyway.

@oxinabox

This comment has been minimized.

Collaborator

oxinabox commented Oct 24, 2018

You can manually run the steps in
https://github.com/malmaud/TensorFlow.jl/blob/master/deps/build.jl

which is:

Put Python Tensorflow somewhere PyCall can find it

if PyCall.conda
Conda.add_channel("conda-forge")
Conda.add("tensorflow=" * cur_py_version)
else
try
pyimport("tensorflow")
# See if it works already
catch ee
typeof(ee) <: PyCall.PyError || rethrow(ee)
error("""
Python TensorFlow not installed
Please either:
- Rebuild PyCall to use Conda, by running in the julia REPL:
- `ENV["PYTHON"]=""; Pkg.build("PyCall"); Pkg.build("TensorFlow")`
- Or install the python binding yourself, eg by running pip
- `pip install tensorflow`
- then rebuilding TensorFlow.jl via `Pkg.build("TensorFlow")` in the julia REPL
- make sure you run the right pip, for the instance of python that PyCall is looking at.
""")
end
end

This can be do either via Conda.jl or via setting ENV["PYTHON"] and using the package manager for that enviroment

Install LibTensorflow

Either by downloading and unpacking
as per

if PyCall.conda
Conda.add_channel("conda-forge")
Conda.add("tensorflow=" * cur_py_version)
else
try
pyimport("tensorflow")
# See if it works already
catch ee
typeof(ee) <: PyCall.PyError || rethrow(ee)
error("""
Python TensorFlow not installed
Please either:
- Rebuild PyCall to use Conda, by running in the julia REPL:
- `ENV["PYTHON"]=""; Pkg.build("PyCall"); Pkg.build("TensorFlow")`
- Or install the python binding yourself, eg by running pip
- `pip install tensorflow`
- then rebuilding TensorFlow.jl via `Pkg.build("TensorFlow")` in the julia REPL
- make sure you run the right pip, for the instance of python that PyCall is looking at.
""")
end
end

or via building from source
https://github.com/malmaud/TensorFlow.jl/blob/master/docs/src/build_from_source.md

@daxinnan daxinnan closed this Oct 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment