Skip to content

Commit

Permalink
move dataset to core.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oceania2018 committed Mar 1, 2020
1 parent f10a72f commit e61a907
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 84 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).


Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using NumSharp;

namespace Tensorflow.Hub
namespace Tensorflow
{
public abstract class DataSetBase : IDataSet
{
Expand Down
6 changes: 0 additions & 6 deletions src/TensorFlowNET.Core/Data/DatasetV1.cs

This file was deleted.

9 changes: 0 additions & 9 deletions src/TensorFlowNET.Core/Data/DatasetV1Adapter.cs

This file was deleted.

21 changes: 0 additions & 21 deletions src/TensorFlowNET.Core/Data/DatasetV2.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using NumSharp;

namespace Tensorflow.Hub
namespace Tensorflow
{
public class Datasets<TDataSet> where TDataSet : IDataSet
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using NumSharp;

namespace Tensorflow.Hub
namespace Tensorflow
{
public interface IDataSet
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using NumSharp;

namespace Tensorflow.Hub
namespace Tensorflow
{
public interface IModelLoader<TDataSet>
where TDataSet : IDataSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
using System.Diagnostics;
using System.Text;
using NumSharp;
using Tensorflow;

namespace Tensorflow.Hub
namespace Tensorflow
{
public class MnistDataSet : DataSetBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.IO;
using NumSharp;

namespace Tensorflow.Hub
namespace Tensorflow
{
public class MnistModelLoader : IModelLoader<MnistDataSet>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using NumSharp;

namespace Tensorflow.Hub
namespace Tensorflow
{
public class ModelLoadSetting
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Tensorflow.Hub
namespace Tensorflow
{
public static class Utils
{
Expand Down
8 changes: 4 additions & 4 deletions src/TensorFlowNET.Core/TensorFlow.Binding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>TensorFlow.NET</AssemblyName>
<RootNamespace>Tensorflow</RootNamespace>
<TargetTensorFlow>1.14.1</TargetTensorFlow>
<Version>0.15.0</Version>
<Version>0.20.0</Version>
<Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors>
<Company>SciSharp STACK</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -18,15 +18,15 @@
<Description>Google's TensorFlow full binding in .NET Standard.
Building, training and infering deep learning models.
https://tensorflownet.readthedocs.io</Description>
<AssemblyVersion>0.15.0.0</AssemblyVersion>
<PackageReleaseNotes>Changes since v0.14.0:
<AssemblyVersion>0.20.0.0</AssemblyVersion>
<PackageReleaseNotes>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</PackageReleaseNotes>
<LangVersion>7.3</LangVersion>
<FileVersion>0.15.0.0</FileVersion>
<FileVersion>0.20.0.0</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<SignAssembly>true</SignAssembly>
Expand Down
11 changes: 0 additions & 11 deletions src/TensorFlowNET.Keras/Engine/BasePreprocessingLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
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
Expand Down Expand Up @@ -44,15 +42,6 @@ public CombinerPreprocessingLayer(Combiner combiner)

private Dictionary<string, NDArray> _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<string, Tensor> updates) => throw new NotImplementedException();

public override void adapt(DatasetV1 data, bool reset_state = true)
{
throw new NotImplementedException();
}
}
}
4 changes: 2 additions & 2 deletions src/TensorFlowNet.Benchmarks/Tensorflow.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.15.1" />
<PackageReference Include="TensorFlow.NET" Version="0.14.2" />
<PackageReference Include="TensorFlow.NET" Version="0.15.0" />
</ItemGroup>

</Project>
22 changes: 8 additions & 14 deletions tensorflowlib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,34 @@ sudo apt install libgdiplus

More information about [System.Drawing on Linux](<https://www.hanselman.com/blog/HowDoYouUseSystemDrawingInNETCore.aspx>).

### 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
Expand Down Expand Up @@ -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`
2 changes: 1 addition & 1 deletion test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;
using Tensorflow.Hub;
using Tensorflow;

namespace TensorFlowNET.UnitTest
{
Expand Down
4 changes: 2 additions & 2 deletions test/TensorFlowNET.UnitTest/Tensorflow.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>

<SignAssembly>true</SignAssembly>
<SignAssembly>false</SignAssembly>

<DelaySign>false</DelaySign>

Expand Down

0 comments on commit e61a907

Please sign in to comment.