You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.5 kB

5 years ago
6 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. TensorFlow.NET pack all required libraries in architecture-specific assemblies folders per NuGet standard.
  2. ```powershell
  3. PM> Install-Package TensorFlow.NET
  4. PM> Install-Package SciSharp.TensorFlow.Redist
  5. ```
  6. ### Run in Linux
  7. Download Linux pre-built library and unzip `libtensorflow.so` and `libtensorflow_framework.so` into current running directory.
  8. To run image recognition in Linux, please ensure some prerequisite libraries is install.
  9. ```shell
  10. sudo apt install libc6-dev
  11. sudo apt install libgdiplus
  12. ```
  13. More information about [System.Drawing on Linux](<https://www.hanselman.com/blog/HowDoYouUseSystemDrawingInNETCore.aspx>).
  14. ### Run TensorFlow with GPU
  15. Before running verify you installed CUDA and cuDNN (TensorFlow v1.15 is compatible with CUDA v10.0 and cuDNN v7.4 , TensorFlow v2.x is compatible with CUDA v10.2 and cuDNN v7.65), and make sure the corresponding cuda version is compatible.
  16. #### Mac OS
  17. There is no GPU support for macOS.
  18. #### GPU for Windows
  19. ```powershell
  20. PM> Install-Package SciSharp.TensorFlow.Redist-Windows-GPU
  21. ```
  22. #### GPU for Linux
  23. ```powershell
  24. PM> Install-Package SciSharp.TensorFlow.Redist-Linux-GPU
  25. ```
  26. ### Download prebuild binary manually
  27. We can't found official prebuild binaries for each platform since tensorflow 2.0. If you know where we can download, please PR here.
  28. ### Build from source for Windows
  29. https://www.tensorflow.org/install/source_windows
  30. Download [Bazel 2.0.0](https://github.com/bazelbuild/bazel/releases/tag/2.0.0) to build tensorflow2.x. We build customized binary to export c_api from this [fork](https://github.com/SciSharp/tensorflow).
  31. Set ENV `BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC`.
  32. `pacman -S git patch unzip`
  33. 1. Build static library
  34. `bazel build --config=opt //tensorflow:libtensorflow.so`
  35. 2. Build pip package
  36. `bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package`
  37. 3. Generate pip installation file
  38. `bazel-bin\tensorflow\tools\pip_package\build_pip_package C:/tmp/tensorflow_pkg`
  39. 4. Install from local wheel file.
  40. `pip install C:/tmp/tensorflow_pkg/tensorflow-1.15.0-cp36-cp36m-win_amd64.whl`
  41. ### Build specific version for tf.net
  42. https://github.com/SciSharp/tensorflow
  43. For Linux version, these APIs symbols should also be put into `tensorflow/c/version_script.lds` to be exported.
  44. Please refer to commit `https://github.com/SciSharp/tensorflow/commit/58122da06be3e7707500ad889dfd5c760a3e0424`