diff --git a/README.md b/README.md index 2a0caeb7..8130fbd7 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,13 @@ [![Join the chat at https://gitter.im/publiclab/publiclab](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sci-sharp/community) [![Tensorflow.NET](https://ci.appveyor.com/api/projects/status/wx4td43v2d3f2xj6?svg=true)](https://ci.appveyor.com/project/Haiping-Chen/tensorflow-net) -[![codecov](https://codecov.io/gh/SciSharp/NumSharp/branch/master/graph/badge.svg)](https://codecov.io/gh/SciSharp/NumSharp) [![NuGet](https://img.shields.io/nuget/dt/TensorFlow.NET.svg)](https://www.nuget.org/packages/TensorFlow.NET) [![Documentation Status](https://readthedocs.org/projects/tensorflownet/badge/?version=latest)](https://tensorflownet.readthedocs.io/en/latest/?badge=latest) [![Badge](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu/#/en_US) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/javiercp/BinderTF.NET/master?urlpath=lab) +*master branch is based on tensorflow 2.1 now, v0.15-tensorflow1.15 is from tensorflow1.15.* + TF.NET is a member project of [SciSharp STACK](https://github.com/SciSharp). @@ -29,10 +30,9 @@ In comparison to other projects, like for instance TensorFlowSharp which only pr | TensorFlow | tf 1.13 | tf 1.14 | tf 1.15 | tf 2.0 | | ----------- | ------- | ------- | ------- | ------ | -| tf.net 0.14 | | x | x | | -| tf.net 0.13 | | x | x | | -| tf.net 0.12 | x | x | | | -| tf.net 0.11 | x | x | | | +| tf.net 0.20 | | | x | x | +| tf.net 0.15 | | x | x | | +| tf.net 0.14 | x | x | | | Install TF.NET and TensorFlow binary through NuGet. ```sh diff --git a/src/TensorFlowNET.Hub/DataSetBase.cs b/src/TensorFlowNET.Core/Data/DataSetBase.cs similarity index 91% rename from src/TensorFlowNET.Hub/DataSetBase.cs rename to src/TensorFlowNET.Core/Data/DataSetBase.cs index dc47b1c8..cf8eaf6a 100644 --- a/src/TensorFlowNET.Hub/DataSetBase.cs +++ b/src/TensorFlowNET.Core/Data/DataSetBase.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using NumSharp; -namespace Tensorflow.Hub +namespace Tensorflow { public abstract class DataSetBase : IDataSet { diff --git a/src/TensorFlowNET.Core/Data/DatasetV1.cs b/src/TensorFlowNET.Core/Data/DatasetV1.cs deleted file mode 100644 index 8739abd4..00000000 --- a/src/TensorFlowNET.Core/Data/DatasetV1.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Tensorflow.Data -{ - public class DatasetV1 : DatasetV2 - { - } -} diff --git a/src/TensorFlowNET.Core/Data/DatasetV1Adapter.cs b/src/TensorFlowNET.Core/Data/DatasetV1Adapter.cs deleted file mode 100644 index a3097ef7..00000000 --- a/src/TensorFlowNET.Core/Data/DatasetV1Adapter.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Tensorflow.Data -{ - /// - /// Wraps a V2 `Dataset` object in the `tf.compat.v1.data.Dataset` API. - /// - public class DatasetV1Adapter : DatasetV1 - { - } -} diff --git a/src/TensorFlowNET.Core/Data/DatasetV2.cs b/src/TensorFlowNET.Core/Data/DatasetV2.cs deleted file mode 100644 index 0c6f6291..00000000 --- a/src/TensorFlowNET.Core/Data/DatasetV2.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace Tensorflow.Data -{ - /// - /// Represents a potentially large set of elements. - /// - /// A `Dataset` can be used to represent an input pipeline as a - /// collection of elements (nested structures of tensors) and a "logical - /// plan" of transformations that act on those elements. - /// - /// tensorflow\python\data\ops\dataset_ops.py - /// - public class DatasetV2 - { - public static DatasetV2 from_generator() - { - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Hub/Datasets.cs b/src/TensorFlowNET.Core/Data/Datasets.cs similarity index 98% rename from src/TensorFlowNET.Hub/Datasets.cs rename to src/TensorFlowNET.Core/Data/Datasets.cs index 6c05efb6..361f74ee 100644 --- a/src/TensorFlowNET.Hub/Datasets.cs +++ b/src/TensorFlowNET.Core/Data/Datasets.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using NumSharp; -namespace Tensorflow.Hub +namespace Tensorflow { public class Datasets where TDataSet : IDataSet { diff --git a/src/TensorFlowNET.Hub/IDataSet.cs b/src/TensorFlowNET.Core/Data/IDataSet.cs similarity index 88% rename from src/TensorFlowNET.Hub/IDataSet.cs rename to src/TensorFlowNET.Core/Data/IDataSet.cs index f38a4217..0b496f96 100644 --- a/src/TensorFlowNET.Hub/IDataSet.cs +++ b/src/TensorFlowNET.Core/Data/IDataSet.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using NumSharp; -namespace Tensorflow.Hub +namespace Tensorflow { public interface IDataSet { diff --git a/src/TensorFlowNET.Hub/IModelLoader.cs b/src/TensorFlowNET.Core/Data/IModelLoader.cs similarity index 91% rename from src/TensorFlowNET.Hub/IModelLoader.cs rename to src/TensorFlowNET.Core/Data/IModelLoader.cs index 530138af..e54a5af2 100644 --- a/src/TensorFlowNET.Hub/IModelLoader.cs +++ b/src/TensorFlowNET.Core/Data/IModelLoader.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Text; using NumSharp; -namespace Tensorflow.Hub +namespace Tensorflow { public interface IModelLoader where TDataSet : IDataSet diff --git a/src/TensorFlowNET.Hub/MnistDataSet.cs b/src/TensorFlowNET.Core/Data/MnistDataSet.cs similarity index 98% rename from src/TensorFlowNET.Hub/MnistDataSet.cs rename to src/TensorFlowNET.Core/Data/MnistDataSet.cs index 4cd9663b..7e0f61bc 100644 --- a/src/TensorFlowNET.Hub/MnistDataSet.cs +++ b/src/TensorFlowNET.Core/Data/MnistDataSet.cs @@ -3,9 +3,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Text; using NumSharp; -using Tensorflow; -namespace Tensorflow.Hub +namespace Tensorflow { public class MnistDataSet : DataSetBase { diff --git a/src/TensorFlowNET.Hub/MnistModelLoader.cs b/src/TensorFlowNET.Core/Data/MnistModelLoader.cs similarity index 99% rename from src/TensorFlowNET.Hub/MnistModelLoader.cs rename to src/TensorFlowNET.Core/Data/MnistModelLoader.cs index 82096452..4940509a 100644 --- a/src/TensorFlowNET.Hub/MnistModelLoader.cs +++ b/src/TensorFlowNET.Core/Data/MnistModelLoader.cs @@ -5,7 +5,7 @@ using System.Text; using System.IO; using NumSharp; -namespace Tensorflow.Hub +namespace Tensorflow { public class MnistModelLoader : IModelLoader { diff --git a/src/TensorFlowNET.Hub/ModelLoadSetting.cs b/src/TensorFlowNET.Core/Data/ModelLoadSetting.cs similarity index 95% rename from src/TensorFlowNET.Hub/ModelLoadSetting.cs rename to src/TensorFlowNET.Core/Data/ModelLoadSetting.cs index 89e46748..94a5bec0 100644 --- a/src/TensorFlowNET.Hub/ModelLoadSetting.cs +++ b/src/TensorFlowNET.Core/Data/ModelLoadSetting.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using NumSharp; -namespace Tensorflow.Hub +namespace Tensorflow { public class ModelLoadSetting { diff --git a/src/TensorFlowNET.Hub/Utils.cs b/src/TensorFlowNET.Core/Data/Utils.cs similarity index 99% rename from src/TensorFlowNET.Hub/Utils.cs rename to src/TensorFlowNET.Core/Data/Utils.cs index 5b06aaad..a1633308 100644 --- a/src/TensorFlowNET.Hub/Utils.cs +++ b/src/TensorFlowNET.Core/Data/Utils.cs @@ -7,7 +7,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -namespace Tensorflow.Hub +namespace Tensorflow { public static class Utils { diff --git a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj index a84d7f75..97fd03de 100644 --- a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj +++ b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj @@ -5,7 +5,7 @@ TensorFlow.NET Tensorflow 1.14.1 - 0.15.0 + 0.20.0 Haiping Chen, Meinrad Recheis, Eli Belash SciSharp STACK true @@ -18,15 +18,15 @@ Google's TensorFlow full binding in .NET Standard. Building, training and infering deep learning models. https://tensorflownet.readthedocs.io - 0.15.0.0 - Changes since v0.14.0: + 0.20.0.0 + Changes since v0.15.0: 1: Add TransformGraphWithStringInputs. 2: tf.trainer.load_graph, tf.trainer.freeze_graph 3: Import Protobuf.Text 4: Support YOLOv3 object detection 5: Add implicitation for Operation to RefVariable 7.3 - 0.15.0.0 + 0.20.0.0 LICENSE true true diff --git a/src/TensorFlowNET.Keras/Engine/BasePreprocessingLayer.cs b/src/TensorFlowNET.Keras/Engine/BasePreprocessingLayer.cs index 61c57d39..46715e5b 100644 --- a/src/TensorFlowNET.Keras/Engine/BasePreprocessingLayer.cs +++ b/src/TensorFlowNET.Keras/Engine/BasePreprocessingLayer.cs @@ -3,14 +3,12 @@ using NumSharp; using System; using System.Collections.Generic; using System.Text; -using Tensorflow.Data; using Tensorflow.Keras.Initializers; namespace Tensorflow.Keras.Engine { public abstract class PreprocessingLayer : Layer { - public abstract void adapt(Data.DatasetV1 data, bool reset_state = true); } public abstract class Combiner @@ -44,15 +42,6 @@ namespace Tensorflow.Keras.Engine private Dictionary _restore_updates() => throw new NotImplementedException(); - private bool _dataset_is_infinite(DatasetV1 dataset) => throw new NotImplementedException(); - - private dynamic _get_dataset_iterator(DatasetV1 dataset) => throw new NotImplementedException(); - private void _set_state_variables(Dictionary updates) => throw new NotImplementedException(); - - public override void adapt(DatasetV1 data, bool reset_state = true) - { - throw new NotImplementedException(); - } } } diff --git a/src/TensorFlowNet.Benchmarks/Tensorflow.Benchmark.csproj b/src/TensorFlowNet.Benchmarks/Tensorflow.Benchmark.csproj index 1c2981e2..96a00a98 100644 --- a/src/TensorFlowNet.Benchmarks/Tensorflow.Benchmark.csproj +++ b/src/TensorFlowNet.Benchmarks/Tensorflow.Benchmark.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.2 + netcoreapp3.1 @@ -20,7 +20,7 @@ - + diff --git a/tensorflowlib/README.md b/tensorflowlib/README.md index 6c5e6901..ad61a8a1 100644 --- a/tensorflowlib/README.md +++ b/tensorflowlib/README.md @@ -18,40 +18,34 @@ sudo apt install libgdiplus More information about [System.Drawing on Linux](). -### Run TensorFlow in GPU +### Run TensorFlow with GPU 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. -#### Run in Mac OS +#### Mac OS There is no GPU support for macOS. -#### Tensorflow GPU for Windows +#### GPU for Windows ```powershell PM> Install-Package SciSharp.TensorFlow.Redist-Windows-GPU ``` -#### Tensorflow GPU for Linux +#### GPU for Linux ```powershell PM> Install-Package SciSharp.TensorFlow.Redist-Linux-GPU ``` ### Download prebuild binary manually -Here are some pre-built TensorFlow binaries you can use for each platform: - -- Linux - - CPU-only: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz - - GPU-enabled: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.15.0.tar.gz -- Mac: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.15.0.tar.gz -- Windows - - CPU-only: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.15.0.zip - - GPU-enabled: https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-windows-x86_64-1.15.0.zip +We can't found official prebuild binaries for each platform since tensorflow 2.0. If you know where we can download, please PR here. ### Build from source for Windows https://www.tensorflow.org/install/source_windows +Download [Bazel 0.29.1](https://github.com/bazelbuild/bazel/releases/tag/0.29.1) to build tensorflow2.x. We build customized binary to export c_api from this [fork](https://github.com/SciSharp/tensorflow). + `pacman -S git patch unzip` 1. Build static library @@ -81,4 +75,4 @@ TF_CAPI_EXPORT extern void RemoveAllControlInputs(TF_Graph* graph, TF_Operation* ``` For Linux version, these APIs symbols should also be put into `tensorflow/c/version_script.lds` to be exported. -Please refer to commit `https://github.com/SciSharp/tensorflow/commit/58122da06be3e7707500ad889dfd5c760a3e0424` +Please refer to commit `https://github.com/SciSharp/tensorflow/commit/58122da06be3e7707500ad889dfd5c760a3e0424` \ No newline at end of file diff --git a/test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs b/test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs index b1c90b32..e2fc0c89 100644 --- a/test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs +++ b/test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading.Tasks; -using Tensorflow.Hub; +using Tensorflow; namespace TensorFlowNET.UnitTest { diff --git a/test/TensorFlowNET.UnitTest/Tensorflow.UnitTest.csproj b/test/TensorFlowNET.UnitTest/Tensorflow.UnitTest.csproj index efbf401c..6e8aa936 100644 --- a/test/TensorFlowNET.UnitTest/Tensorflow.UnitTest.csproj +++ b/test/TensorFlowNET.UnitTest/Tensorflow.UnitTest.csproj @@ -1,11 +1,11 @@  - netcoreapp3.0 + netcoreapp3.1 false - true + false false