Skip to content

Commit 57151be

Browse files
authored
Merge pull request #157 from adamcrume/master
Update prerequisites and usage instructions, and point to examples folder
2 parents 96fb5a2 + a1adc54 commit 57151be

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

README.md

+22-8
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,22 @@ stable API. This is especially true because the underlying TensorFlow C API has
1010
been stabilized as well.
1111

1212
* [Documentation](https://tensorflow.github.io/rust/tensorflow/)
13+
* [TensorFlow Rust Google Group](https://groups.google.com/a/tensorflow.org/forum/#!forum/rust)
1314
* [TensorFlow website](https://www.tensorflow.org)
1415
* [TensorFlow GitHub page](https://github.com/tensorflow/tensorflow)
1516

1617
## Getting Started
17-
Since this crate depends on the TensorFlow C API, it needs to be compiled first. This crate will
18-
automatically compile TensorFlow for you, but it is also possible to manually install TensorFlow
19-
and the crate will pick it up accordingly.
18+
Since this crate depends on the TensorFlow C API, it needs to be downloaded or compiled first. This
19+
crate will automatically download or compile the TensorFlow shared libraries for you, but it is also
20+
possible to manually install TensorFlow and the crate will pick it up accordingly.
2021

2122
### Prerequisites
22-
The following dependencies are needed to compile and build this crate (assuming TensorFlow itself
23-
should also be compiled transparently):
23+
If the TensorFlow shared libraries can already be found on your system, they will be used. If your
24+
system is x86-64 Linux or Mac, a prebuilt binary will be downloaded, and no special prerequisites
25+
are needed.
26+
27+
Otherwise, the following dependencies are needed to compile and build this crate, which involves
28+
compiling TensorFlow itself:
2429

2530
- git
2631
- [bazel](https://bazel.build/)
@@ -31,6 +36,9 @@ The TensorFlow website provides detailed instructions on how to obtain and insta
3136
so if you are unsure please [check out the docs](https://www.tensorflow.org/install/install_sources)
3237
for further details.
3338

39+
Some of the examples use TensorFlow code written in Python and require a full TensorFlow
40+
intallation.
41+
3442
### Usage
3543
Add this to your `Cargo.toml`:
3644

@@ -73,7 +81,7 @@ In short:
7381
1. Install [SWIG](http://www.swig.org) and [NumPy](http://www.numpy.org). The
7482
version from your distro's package manager should be fine for these two.
7583
2. [Install Bazel](https://bazel.io/docs/install.html), which you may need to do
76-
from source.
84+
from source. You will likely need an up-to-date version.
7785
3. `git clone https://github.com/tensorflow/tensorflow`
7886
4. `cd tensorflow`
7987
5. `./configure`
@@ -82,8 +90,8 @@ In short:
8290
Using `--jobs=1` is recommended unless you have a lot of RAM, because
8391
TensorFlow's build is very memory intensive.
8492

85-
Copy `$TENSORFLOW_SRC/bazel-bin/tensorflow/libtensorflow.so` to `/usr/local/lib`.
86-
If this is not possible, add `$TENSORFLOW_SRC/bazel-bin/tensorflow` to
93+
Copy `$TENSORFLOW_SRC/bazel-bin/tensorflow/libtensorflow.so` and `libtensorflow_framework.so` to
94+
`/usr/local/lib`. If this is not possible, add `$TENSORFLOW_SRC/bazel-bin/tensorflow` to
8795
`LD_LIBRARY_PATH`.
8896

8997
You may need to run `ldconfig` to reset `ld`'s cache after copying `libtensorflow.so`.
@@ -100,6 +108,12 @@ use. See http://doc.crates.io/manifest.html#the-features-section.
100108
(We would prefer using an `#[unstable]` attribute, but that
101109
[doesn't exist](https://github.com/rust-lang/rfcs/issues/1491) yet.)
102110

111+
### How do I...?
112+
Try the [documentation](https://tensorflow.github.io/rust/tensorflow/) first, and see if it answers
113+
your question. If not, take a look at the examples folder. Note that there may not be an example
114+
for your exact question, but it may be answered by an example demonstrating something else.
115+
116+
103117
## Contributing
104118
Developers and users are welcome to join the
105119
[TensorFlow Rust Google Group](https://groups.google.com/a/tensorflow.org/forum/#!forum/rust).

src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! This crate provides Rust bindings for the
22
//! [`TensorFlow`](https://www.tensorflow.org) machine learning library.
3+
//!
4+
//! If you aren't sure how to use something, please see the
5+
//! [examples](https://github.com/tensorflow/rust/tree/master/examples) folder.
36
47
#![warn(missing_copy_implementations,
58
missing_debug_implementations,

0 commit comments

Comments
 (0)