tensorflow / rust

Rust language bindings for TensorFlow
Apache License 2.0
5.17k stars 422 forks source link

Regular build problems on macOS #237

Open olegnn opened 4 years ago

olegnn commented 4 years ago

OS: Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64.

If add latest version (0.14.0) with features = ["tensorflow_gpu"] to Cargo.toml, most of times I get errors like

error: failed to run custom build command for `tensorflow-sys v0.17.0`
process didn't exit successfully: `/Users/oleg/Documents/tensor/target/debug/build/tensorflow-sys-50c9e60f7f8ecb02/build-script-build` (exit code: 101)
--- stdout
libtensorflow-sys/build.rs:119: binary_url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-darwin-x86_64-1.13.1.tar.gz"
libtensorflow-sys/build.rs:123: base_name = "libtensorflow-gpu-darwin-x86_64-1.13.1"
libtensorflow-sys/build.rs:132: file_name = "/Users/oleg/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.17.0/target/libtensorflow-gpu-darwin-x86_64-1.13.1.tar.gz"

--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: TarError { desc: "failed to iterate over archive", io: Custom { kind: InvalidInput, error: "invalid gzip header" } } }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

or something similar (invalid gzip header, corrupt deflate stream etc). cargo clean, removing ./target and cleaning ~/.cargo cache don't help, it happens regularly.

But version 0.13.0 isn't available at all

error: failed to run custom build command for `tensorflow-sys v0.16.0`
Caused by:
  process didn't exit successfully: `/Users/oleg/Documents/tensor/target/debug/build/tensorflow-sys-ac1a44ddb802a9bd/build-script-build` (exit code: 101)
--- stdout
libtensorflow-sys/build.rs:109: binary_url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-darwin-x86_64-1.13.1.tar.gz"
libtensorflow-sys/build.rs:113: base_name = "libtensorflow-gpu-darwin-x86_64-1.13.1"
libtensorflow-sys/build.rs:122: file_name = "/Users/oleg/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.16.0/target/libtensorflow-gpu-darwin-x86_64-1.13.1.tar.gz"
--- stderr
thread 'main' panicked at 'Unexpected response code 404 for https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-darwin-x86_64-1.13.1.tar.gz', /Users/oleg/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.16.0/build.rs:137:13
nusairat commented 4 years ago

Same issue as well, unfortunately I can't view that Google APIs directory so hard To debug whats available whats not available.

anirudhvenk commented 3 years ago

Same issue - any fix yet?

brr53 commented 3 years ago

I am facing the same issue.

dskkato commented 3 years ago

First of all, tensorflow_gpu feature is not supported as the official site states:

Install GPU support (optional, Linux only) There is no GPU support for macOS.

https://www.tensorflow.org/install/source#install_gpu_support_optional_linux_only

Still, you can use this binding without tensorflow_gpu on macOS.

The error messages themselves are not user-friendly and may need to be polished.