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.6 kB

6 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. TensorFlow.NET pack all required libraries in architecture-specific assemblies folders per NuGet standard [Deprecated] .
  2. We changed to use `Microsoft.ML.TensorFlow.Redist` to maintain the TensorFlow library.
  3. ### Download manually
  4. Here are some pre-built TensorFlow binaries you can use for each platform:
  5. - Linux
  6. - CPU-only: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz
  7. - GPU-enabled: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.14.0.tar.gz
  8. - Mac: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz
  9. - Windows
  10. - CPU-only: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.14.0.zip
  11. - GPU-enabled: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-windows-x86_64-1.14.0.zip
  12. ### Run in Linux
  13. `Install-Package TensorFlow.NET`
  14. Download Linux pre-built library and unzip `libtensorflow.so` and `libtensorflow_framework.so` into current running directory.
  15. To run image recognition in Linux, please ensure some prerequisite libraries is install.
  16. ```shell
  17. sudo apt install libc6-dev
  18. sudo apt install libgdiplus
  19. ```
  20. More information about [System.Drawing on Linux](<https://www.hanselman.com/blog/HowDoYouUseSystemDrawingInNETCore.aspx>).
  21. ### Run in Mac OS
  22. ### Tensorflow GPU for Windows
  23. Before running verify you installed CUDA and cuDNN (TensorFlow v1.14 is compatible with CUDA v10.0 and cuDNN v7.4), and make sure the corresponding cuda version is compatible.
  24. ```powershell
  25. PM> Install-Package SciSharp.TensorFlow.Redist-Windows-GPU
  26. ```
  27. ### Build from source for Windows
  28. https://www.tensorflow.org/install/source_windows
  29. `pacman -S git patch unzip`
  30. 1. Build static library
  31. `bazel build --config=opt //tensorflow:libtensorflow.so`
  32. 2. Build pip package
  33. `bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package`
  34. 3. Generate pip installation file
  35. `bazel-bin\tensorflow\tools\pip_package\build_pip_package C:/tmp/tensorflow_pkg`
  36. 4. Install from local wheel file.
  37. `pip install C:/tmp/tensorflow_pkg/tensorflow-1.14.0-cp36-cp36m-win_amd64.whl`
  38. ### Export more APIs
  39. Add more api to `c_api.h`
  40. ```c++
  41. TF_CAPI_EXPORT extern void AddControlInput(TF_Graph* graph, TF_Operation* op, TF_Operation* input);
  42. TF_CAPI_EXPORT extern void UpdateEdge(TF_Graph* graph, TF_Output new_src, TF_Input dst, TF_Status* status);
  43. TF_CAPI_EXPORT extern void RemoveAllControlInputs(TF_Graph* graph, TF_Operation* op);
  44. ```