I'm not sure, I haven't exactly found the origin yet as previously I did not have this issue. It seems to be happening in the resulting Tensor object that is returned after callling the Apply() method to a network (outside of training in this case but calling the network to make predictions). Before I was using fairly small result tensors (e.g. a categorisation problem with only 2 options), but now I'm using one that has 1300+ options; significantly more. I think the issue was masked before as the GC would at some point get triggered anyway, so that the tiny tensors from before were cleared properly. But with these large tensors, the issue happens way sooner before the GC can trigger.
I should note that I'm not using the latest TF.NET version, because I can't for the life of me get that one to run (using 2.3.1 from NuGet). Not sure if an issue like this has been solved already in 2.4.
List<Vector3> testList = new List<Vector3>(); testList.Add(new Vector3(0, 1, 2)); testList.Add(new Vector3(3, 4, 5)); testList.Add(new Vector3(6, 7, 8)); Vector3 arrayTestList = testList.ToArray(); NDArray testNdArray = np.array(arrayTestList);
1 training) at Tensorflow.Keras.Engine.Layer.<>c__DisplayClass1_0.<Apply>b__0(NameScope scope) at Tensorflow.Binding.tf_with[T](T py, Action1 action)
@Oceania2018 I'm new to neural networks and tensorflow. I'm not sure what I would unit test.
Would this help?: