rust
rust copied to clipboard
Failed to compile tensorflow_gpu
I'm having trouble getting started with tensorflow on rust. I'm stuck with the following error while building a project that uses the tensorflow_gpu feature:
Compiling tensorflow-sys v0.18.0
error: failed to run custom build command for `tensorflow-sys v0.18.0`
Caused by:
process didn't exit successfully: `/.../target/debug/build/tensorflow-sys-02bc4d6528457007/build-script-build` (exit code: 101)
--- stdout
libtensorflow-sys/build.rs:119: binary_url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.13.1.tar.gz"
libtensorflow-sys/build.rs:123: base_name = "libtensorflow-gpu-linux-x86_64-1.13.1"
libtensorflow-sys/build.rs:132: file_name = "/{...}/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.18.0/target/libtensorflow-gpu-linux-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 unpack `/{...}/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.18.0/target/libtensorflow-gpu-linux-x86_64-1.13.1/lib/libtensorflow.so`", io: Custom { kind: InvalidInput, error: TarError { desc: "failed to unpack `./lib/libtensorflow.so` into `/{...}/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.18.0/target/libtensorflow-gpu-linux-x86_64-1.13.1/lib/libtensorflow.so`", io: Custom { kind: InvalidInput, error: "corrupt deflate stream" } } } } }', /{...}/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.18.0/build.rs:100:5
stack backtrace:
0: 0x55951a9e1b64 - backtrace::backtrace::libunwind::trace::h5ae3454ebe40b621
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
1: 0x55951a9e1b64 - backtrace::backtrace::trace_unsynchronized::hbf6f267a483fb2c0
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
2: 0x55951a9e1b64 - std::sys_common::backtrace::_print_fmt::h37755015d94b9085
at src/libstd/sys_common/backtrace.rs:78
3: 0x55951a9e1b64 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0561c8cd3569b40d
at src/libstd/sys_common/backtrace.rs:59
4: 0x55951aa025cc - core::fmt::write::h86a597a35d48a212
at src/libcore/fmt/mod.rs:1063
5: 0x55951a9de8d3 - std::io::Write::write_fmt::h73d9dc0f29eefe48
at src/libstd/io/mod.rs:1426
6: 0x55951a9e4235 - std::sys_common::backtrace::_print::h6c60c5ee09af0233
at src/libstd/sys_common/backtrace.rs:62
7: 0x55951a9e4235 - std::sys_common::backtrace::print::hf9d1db01634f9b2a
at src/libstd/sys_common/backtrace.rs:49
8: 0x55951a9e4235 - std::panicking::default_hook::{{closure}}::h1db9298dd213ae95
at src/libstd/panicking.rs:204
9: 0x55951a9e3f82 - std::panicking::default_hook::h3272faf6cc91fd2e
at src/libstd/panicking.rs:224
10: 0x55951a9e4892 - std::panicking::rust_panic_with_hook::hb976084785e50594
at src/libstd/panicking.rs:470
11: 0x55951a9e447b - rust_begin_unwind
at src/libstd/panicking.rs:378
12: 0x55951aa01941 - core::panicking::panic_fmt::h45f7d6868edb5678
at src/libcore/panicking.rs:85
13: 0x55951aa01763 - core::option::expect_none_failed::hd7ba247f271405e7
at src/libcore/option.rs:1211
14: 0x55951a8d42b0 - core::result::Result<T,E>::unwrap::hff3ece5e0276b40f
at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/libcore/result.rs:1003
15: 0x55951a8c2430 - build_script_build::extract::h5cddacec979f96a6
at /{...}/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.18.0/build.rs:100
16: 0x55951a8c3759 - build_script_build::install_prebuilt::h1a1587cd71010cbe
at /{...}/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.18.0/build.rs:161
17: 0x55951a8c21ad - build_script_build::main::h1d5cf6b539ddc3c8
at /{...}/.cargo/registry/src/github.com-1ecc6299db9ec823/tensorflow-sys-0.18.0/build.rs:62
18: 0x55951a8d621b - std::rt::lang_start::{{closure}}::h1b98ded690de1491
at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/libstd/rt.rs:67
19: 0x55951a9e4353 - std::rt::lang_start_internal::{{closure}}::hc0a1280e68ffc5da
at src/libstd/rt.rs:52
20: 0x55951a9e4353 - std::panicking::try::do_call::h1d43a4d29f303ef5
at src/libstd/panicking.rs:303
21: 0x55951a9ecb67 - __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:86
22: 0x55951a9e4e7c - std::panicking::try::h5ef738612ab0072d
at src/libstd/panicking.rs:281
23: 0x55951a9e4e7c - std::panic::catch_unwind::h1df9a04c7f1c6fc3
at src/libstd/panic.rs:394
24: 0x55951a9e4e7c - std::rt::lang_start_internal::h97d4af4643f4b0e4
at src/libstd/rt.rs:51
25: 0x55951a8d61f7 - std::rt::lang_start::h870b024894ca1960
at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/libstd/rt.rs:67
26: 0x55951a8c957a - main
27: 0x7f174ecd1b97 - __libc_start_main
28: 0x55951a8c1c9a - _start
29: 0x0 - <unknown>
This is the content of my Cargo.toml file:
[package]
name = "rs-tf"
version = "0.1.0"
edition = "2018"
[dependencies]
tensorflow = { version = "0.15.0", features = [ "experimental_training", "tensorflow_gpu" ] }
The error says "corrupt deflate stream", so I suspect the downloaded archive was corrupted. Try cargo clean and recompiling.