Skip to content

Commit 4e0c062

Browse files
committed
merge
2 parents 44866ba + 66eddd6 commit 4e0c062

31 files changed

Lines changed: 1055 additions & 81 deletions

TensorFlow.NET.sln

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Hub", "src\Te
1515
EndProject
1616
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Datasets", "src\TensorFlowNET.Datasets\TensorFlowNET.Datasets.csproj", "{494D6CAD-2C0D-4C0B-90E2-B097DB039383}"
1717
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NumSharp.Core", "..\NumSharp\src\NumSharp.Core\NumSharp.Core.csproj", "{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}"
19-
EndProject
2018
Global
2119
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2220
Debug|Any CPU = Debug|Any CPU
@@ -99,18 +97,6 @@ Global
9997
{494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Release|Any CPU.Build.0 = Release|Any CPU
10098
{494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Release|x64.ActiveCfg = Release|Any CPU
10199
{494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Release|x64.Build.0 = Release|Any CPU
102-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
103-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
104-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Debug|x64.ActiveCfg = Debug|x64
105-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Debug|x64.Build.0 = Debug|x64
106-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
107-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Publish|Any CPU.Build.0 = Publish|Any CPU
108-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Publish|x64.ActiveCfg = Publish|x64
109-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Publish|x64.Build.0 = Publish|x64
110-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
111-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Release|Any CPU.Build.0 = Release|Any CPU
112-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Release|x64.ActiveCfg = Release|x64
113-
{9249BCC4-3FEB-4EF5-8AB9-789FFE4040B4}.Release|x64.Build.0 = Release|x64
114100
EndGlobalSection
115101
GlobalSection(SolutionProperties) = preSolution
116102
HideSolutionNode = FALSE

src/SciSharp.TensorFlow.Redist/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Related merged [commits](https://github.com/SciSharp/TensorFlow.NET/commit/854a5
2626

2727
On Windows, the tar command does not support extracting archives with symlinks. So when `dotnet pack` runs on Windows it will only package the Windows binaries.
2828

29-
1. Run `dotnet pack SciSharp.TensorFlow.Redist-CPU.nupkgproj` under `src/SciSharp.TensorFlow.Redist` directory in Linux.
30-
2. Run `dotnet nuget push SciSharp.TensorFlow.Redist.1.14.0.nupkg -k APIKEY -s https://api.nuget.org/v3/index.json`
29+
1. Run `dotnet pack SciSharp.TensorFlow.Redist.nupkgproj` under `src/SciSharp.TensorFlow.Redist` directory in Linux.
30+
2. Run `dotnet nuget push SciSharp.TensorFlow.Redist.1.15.0.nupkg -k APIKEY -s https://api.nuget.org/v3/index.json`
3131

3232

src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist-CPU.nupkgproj renamed to src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
99
<TargetFramework>netstandard2.0</TargetFramework>
10-
<TensorFlowVersion>1.14.0</TensorFlowVersion>
10+
<TensorFlowVersion>1.15.0</TensorFlowVersion>
1111
<TensorFlowMajorVersion>1</TensorFlowMajorVersion>
1212

1313
<PackageAssetsPath>$(BinDir)packages\</PackageAssetsPath>
@@ -38,22 +38,22 @@
3838
<TensorFlowConfig Include="windows"
3939
FileExtension=".zip"
4040
FilesFromArchive="lib\tensorflow.dll;
41-
include\tensorflow\c\LICENSE"
41+
LICENSE"
4242
Runtime="win-x64"/>
4343

4444
<TensorFlowConfig Condition="'$(OS)' != 'Windows_NT'"
4545
Include="linux"
4646
FileExtension=".tar.gz"
4747
FilesFromArchive="lib\libtensorflow.so;
4848
lib\libtensorflow_framework.so.$(TensorFlowMajorVersion);
49-
include\tensorflow\c\LICENSE"
49+
LICENSE"
5050
Runtime="linux-x64" />
5151

5252
<TensorFlowConfig Condition="'$(OS)' != 'Windows_NT'"
5353
Include="darwin" FileExtension=".tar.gz"
5454
FilesFromArchive="lib\libtensorflow.dylib;
5555
lib\libtensorflow_framework.$(TensorFlowMajorVersion).dylib;
56-
include\tensorflow\c\LICENSE"
56+
LICENSE"
5757
Runtime="osx-x64" />
5858

5959
<AdditionalDownloadFile Include="https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE"

src/TensorFlowNET.Core/APIs/tf.train.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public RefVariable get_global_step(Graph graph)
3434
public Optimizer GradientDescentOptimizer(float learning_rate)
3535
=> new GradientDescentOptimizer(learning_rate);
3636

37+
public Optimizer GradientDescentOptimizer(Tensor learning_rate)
38+
=> new GradientDescentOptimizer(learning_rate);
39+
3740
public Optimizer AdamOptimizer(float learning_rate, string name = "Adam")
3841
=> new AdamOptimizer(learning_rate, name: name);
3942

src/TensorFlowNET.Core/Binding.Util.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public static void tf_with<T>(T py, Action<T> action) where T : IObjectLife
129129
}
130130
}
131131

132+
[DebuggerStepThrough]
132133
[DebuggerNonUserCode()] // with "Just My Code" enabled this lets the debugger break at the origin of the exception
133134
public static TOut tf_with<TIn, TOut>(TIn py, Func<TIn, TOut> action) where TIn : IObjectLife
134135
{

src/TensorFlowNET.Core/Framework/meta_graph.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static (Dictionary<string, VariableV1>, ITensorOrOperation[]) import_scop
134134
}
135135
break;
136136
default:
137-
Console.WriteLine("import_scoped_meta_graph_with_return_elements");
137+
Console.WriteLine($"import_scoped_meta_graph_with_return_elements {col.Key}");
138138
continue;
139139
}
140140
}

src/TensorFlowNET.Core/Framework/smart_module.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
******************************************************************************/
1616

1717
using System;
18+
using static Tensorflow.Binding;
1819

1920
namespace Tensorflow.Framework
2021
{

src/TensorFlowNET.Core/Graphs/Graph.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ all variables that are created during the construction of a graph. The caller
7575
/// then create a TensorFlow session to run parts of the graph across a set of local and remote devices.
7676
/// </summary>
7777
/// <remarks>https://www.tensorflow.org/guide/graphs <br></br>https://www.tensorflow.org/api_docs/python/tf/Graph</remarks>
78-
public partial class Graph : DisposableObject, IEnumerable<Operation>
78+
public partial class Graph : DisposableObject//, IEnumerable<Operation>
7979
{
8080
private Dictionary<int, ITensorOrOperation> _nodes_by_id;
8181
public Dictionary<string, ITensorOrOperation> _nodes_by_name;
@@ -257,17 +257,17 @@ public Operation create_op(string op_type, Tensor[] inputs, TF_DataType[] dtypes
257257
if (inputs == null)
258258
inputs = new Tensor[0];
259259

260-
foreach ((int idx, Tensor a) in enumerate(inputs))
261-
{
262-
263-
}
264-
265-
if (String.IsNullOrEmpty(name))
260+
if (string.IsNullOrEmpty(name))
266261
name = op_type;
267262
// If a names ends with a '/' it is a "name scope" and we use it as-is,
268263
// after removing the trailing '/'.
269264
name = name.EndsWith("/") ? ops.name_from_scope_name(name) : unique_name(name);
270265
var node_def = ops._NodeDef(op_type, name, device: "", attrs: attrs);
266+
267+
if (name.Contains("define_loss/bigger_box_loss/mul_13"))
268+
{
269+
270+
}
271271

272272
var input_ops = inputs.Select(x => x.op).ToArray();
273273
var control_inputs = _control_dependencies_for_inputs(input_ops);
@@ -526,14 +526,14 @@ public override string ToString()
526526
return debugString;*/
527527
}
528528

529-
private IEnumerable<Operation> GetEnumerable()
529+
/*private IEnumerable<Operation> GetEnumerable()
530530
=> c_api_util.tf_operations(this);
531531
532532
IEnumerator<Operation> IEnumerable<Operation>.GetEnumerator()
533533
=> GetEnumerable().GetEnumerator();
534534
535535
IEnumerator IEnumerable.GetEnumerator()
536-
=> throw new NotImplementedException();
536+
=> throw new NotImplementedException();*/
537537

538538
public static implicit operator IntPtr(Graph graph)
539539
{

src/TensorFlowNET.Core/Keras/Engine/Sequential.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public void add(Layer layer)
5656
{
5757
// Instantiate an input layer.
5858
var x = keras.layers.Input(
59-
batch_shape: batch_shape,
60-
dtype: dtype,
61-
name: layer.name + "_input");
59+
batch_shape: batch_shape,
60+
dtype: dtype,
61+
name: layer.name + "_input");
6262

6363
// This will build the current layer
6464
// and create the node connecting the current layer
@@ -71,7 +71,7 @@ public void add(Layer layer)
7171
if (set_inputs)
7272
{
7373
// If an input layer (placeholder) is available.
74-
// outputs = layer._inbound_nodes;
74+
// outputs = layer.inbound_nodes;
7575
}
7676

7777
}

src/TensorFlowNET.Core/Keras/Layers/Layer.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public Tensor __call__(Tensor[] inputs,
106106
VariableScope scope = null)
107107
{
108108
var input_list = inputs;
109+
var input = inputs[0];
109110
Tensor outputs = null;
110111

111112
// We will attempt to build a TF graph if & only if all inputs are symbolic.
@@ -139,6 +140,7 @@ public Tensor __call__(Tensor[] inputs,
139140
_maybe_build(inputs[0]);
140141

141142
outputs = call(inputs[0], training: training);
143+
(input, outputs) = _set_connectivity_metadata_(input, outputs);
142144
_handle_activity_regularization(inputs[0], outputs);
143145
_set_mask_metadata(inputs[0], outputs, null);
144146
});
@@ -147,6 +149,12 @@ public Tensor __call__(Tensor[] inputs,
147149
return outputs;
148150
}
149151

152+
private (Tensor, Tensor) _set_connectivity_metadata_(Tensor inputs, Tensor outputs)
153+
{
154+
//_add_inbound_node(input_tensors: inputs, output_tensors: outputs);
155+
return (inputs, outputs);
156+
}
157+
150158
private void _handle_activity_regularization(Tensor inputs, Tensor outputs)
151159
{
152160
//if(_activity_regularizer != null)
@@ -224,7 +232,7 @@ protected virtual VariableV1 add_weight(string name,
224232
overwrite: true,
225233
initializer: initializer,
226234
trainable: trainable.Value);
227-
backend.track_variable(variable);
235+
//backend.track_variable(variable);
228236
_trainable_weights.Add(variable);
229237

230238
return variable;

0 commit comments

Comments
 (0)