Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
minhduc66532
@minhduc66532
var shape = Z.shape;
var (u, v) = np.meshgrid(np.arange(shape[1]), np.arange(shape[0]));
var x = (u - Cu) Z / f; <--- error raised here
var y = (v - Cv)
Z / f;
return np.vstack(x.ravel(), y.ravel(), Z.ravel());
Any ideas ?
Niklas Gustafsson
@NiklasGustafsson

Hi! I was going to see if I could add 1D convolution, by essentially doing everything parallel to Conv2D. I'm running into an issue when calling into the native code, where it says that "Conv1D" is not registered in a binary. I get the error on line 172 in EagerRunner.TFE_FastPathExcute.cs, and it says: "'Conv1D' is neither a type of a primitive operation nor a name of a function registered in binary running on MININT-UEGLSID. Make sure the operation or function is registered in the binary running in this process."

So, that makes me wonder whether a) there's no Conv1D operator in the TF native code, or whether b) there's some registration mechanism that I'm missing. I'll go take a look at the Keras Python code, but I was curious if anyone knows right off the top of your head what the mechanism is for registering operators.

Niklas Gustafsson
@NiklasGustafsson
I found it: In the Python code, 1D is reshaped to 2D and Conv2D is called. Never mind!
PatZhang
@akaimody123
Hi, can anyone suggests me how to use it in Unity+LInux? It works well when I run it on Unity+Windows but it fails (Unity crashes) when I run it on Linux.
William Roseberry
@RoseberryPi

So I have a .Net application that uses PythonNet to interface with some Python code. I used anaconda to install CadQuery in a virtual environment (a pip install isn't available so anaconda only) and I'm struggling to figure out how to package the python environment with my .Net application.

I was reading about the Python.Includednuget package but it only distributes base python and only has support for pip(?). Does anyone have any recommendations for what I'm trying to do?

Moranic
@Moranic
Quick question: I noticed that converting a Tensor object to a float[] using ToArray<float>() takes a surprisingly long time. Is there a more optimised way of doing this (e.g. reading from the Tensor directly) or is it just that slow?
Haiping
@Oceania2018
@Moranic You can read data through Tensor.DataPoint that points to the memory address.
xb446909
@xb446909
@Oceania2018 Hi, I tried to solve Linear Regression using TensorFlow.Keras, but it crashed. Any suggestions?
        var X = np.array(3.3f, 4.4f, 5.5f, 6.71f, 6.93f, 4.168f, 9.779f, 6.182f, 7.59f, 2.167f,
                     7.042f, 10.791f, 5.313f, 7.997f, 5.654f, 9.27f, 3.1f);
        var Y = np.array(1.7f, 2.76f, 2.09f, 3.19f, 1.694f, 1.573f, 3.366f, 2.596f, 2.53f, 1.221f,
                     2.827f, 3.465f, 1.65f, 2.904f, 2.42f, 2.94f, 1.3f);

        var model = keras.Sequential();

        model.add(new Dense(new Tensorflow.Keras.ArgsDefinition.DenseArgs()
        {
            InputShape = new TensorShape(new[] { 1 }),
            Units = 1
        }));

        model.summary();
        model.compile(loss: keras.losses.MeanSquaredError(), optimizer: keras.optimizers.SGD(0.005f), metrics: new[] { "acc" });
        model.fit(X, Y);
It worked well in Keras.Net
var X = np.array(3.3f, 4.4f, 5.5f, 6.71f, 6.93f, 4.168f, 9.779f, 6.182f, 7.59f, 2.167f,
7.042f, 10.791f, 5.313f, 7.997f, 5.654f, 9.27f, 3.1f);
var Y = np.array(1.7f, 2.76f, 2.09f, 3.19f, 1.694f, 1.573f, 3.366f, 2.596f, 2.53f, 1.221f,
2.827f, 3.465f, 1.65f, 2.904f, 2.42f, 2.94f, 1.3f);
        var model = new Sequential();
        model.Add(new Dense(1, input_dim: 1));

        model.Summary();
        model.Compile(optimizer: "sgd", loss: "mse");
        model.Fit(X, Y, epochs:2000);
Richard Pook Allpike
@Pookalton_twitter
Is there anything equivalent to np.newbyteorder, how can I change the byte order of an array.
Albahrani1995
@Albahrani1995
Hello, so I want to use tensor flow with FSharp, and also want to use PlaidML, because I have an AMD GPU, but I don't know how to do it, I found how to do it in Python, but I don't know how to translate it into FSharp code,
import os
os.environ["KERA_BACKEND"] = "plaidml.keras.backend"
Meinrad Recheis
@henon
Hi guys, a German dude wrote a German book about ML and in one of the chapters he shows TensorFlow.NET. https://www.hanser-kundencenter.de/fachbuch/artikel/9783446462298
Oh-Junho-KR
@Oh-Junho-KR

Hello. I am a student who knows SciSharp and is in the process of testing.

I modified the DetectionInMobilenet.cs source to run TFv1 different kind of frozen_inference_graph.pb.

In the model trained with TFv2, frozen_inference_graph.pb does not exist, and saved_model.pb exists, so I ran it with saved_model.pb, but the test does not proceed.

Is it currently impossible to test with the TFv2 model?

Oh-Junho-KR
@Oh-Junho-KR

Currently, I am testing with 2.4.0gpu on PC and I get an error when importing TFv2 model.

The importing code is when graph.import(Path.Join(,)) is in the ImportGraph() function of TensorFlow.NET.Examples.

BlueKiwiEntertainment
@BlueKiwiEntertainment
Hello. Happy to join. First time using gitter. You lot have a discord server?
Wow I see a lot of questions ><
BlueKiwiEntertainment
@BlueKiwiEntertainment
How can I rebuild TF.NET with AVX-512?
BlueKiwiEntertainment
@BlueKiwiEntertainment
If you teach me how to compile the redist I can help to contribute :)
BlueKiwiEntertainment
@BlueKiwiEntertainment
Do you guys have keras.applications coming soon?
Haiping
@Oceania2018
@BlueKiwiEntertainment There is good tutorial with building redist: https://www.tensorflow.org/install/source
s
@Esfahani___twitter
@Oceania2018 hi, I wanted to ask is there a way so that I can load my trained keras python model in tensorflow.net? The format of my model is h5
Haiping
@Oceania2018
Try model.load_weights
s
@Esfahani___twitter
Thank you. It says that keras version should be 2.5 or later
s
@Esfahani___twitter
I think the last keras python version is 2.4
bbhxwl
@bbhxwl
Can I use cuda9.0?
Moranic
@Moranic
Question: I have a dataset that I can fit compressed into memory, but I can't expand the data to actual inputs because then I would go well over. I thus need to only decompress the next batch of data or so, so that everything will still fit. Is there a nice way of doing this with the DataSet classes or should I just make multiple datasets instead and replace them after a couple steps?
Baptiste ZLOCH
@BaptisteZloch

Hi! I got an issue while trying to develop a simple windows form to test TensorFlow.NET. I got the following error :
{"cannot compute MatMul as input #1(zero-based) was expected to be a double tensor but is a float tensor"}
While running this code, error occurs when calling model.fit :
`

        var train_Y = np.array(-1.0, 1.0, 3.0, 5.0, 7.0); 
        var train_X = np.array(0.0, 1.0, 2.0, 3.0, 4.0);
        var layers = new LayersApi();
        var inputs = keras.Input(shape: (1),dtype:TF_DataType.TF_FLOAT);
        var outputs = layers.Dense(1).Apply(inputs);
        model = keras.Model(inputs, outputs);
        model.summary();

        model.compile(optimizer: keras.optimizers.Adam(1e-3f),
            loss: keras.losses.MeanSquaredError(),
            metrics: new[] { "acc" });

        model.fit(train_X, train_Y, epochs: 100);

`
Any suggestion ???

Haiping
@Oceania2018
var train_Y = np.array(-1.0f, 1.0f, 3.0f, 5.0f, 7.0f);
@BaptisteZloch
Baptiste ZLOCH
@BaptisteZloch

var train_Y = np.array(-1.0f, 1.0f, 3.0f, 5.0f, 7.0f);

That doesn't work @Oceania2018 ....
Same error as before.

Haiping
@Oceania2018
@BaptisteZloch need to change train_X as well.
Baptiste ZLOCH
@BaptisteZloch

@BaptisteZloch need to change train_X as well.

Yes sorry thanks now I don't get the same error I think I have to reshape my train y and x, I will find out, Thanks a lot for your help !!!

Moranic
@Moranic
There seems to be an issue where the unmanaged resources of tensors are not applying GC pressure, which causes the GC to ignore them and eventually causes the program to run out of memory. Is this a known issue?
The objects end up on the finalizer queue allright, but then are never cleared.
Haiping
@Oceania2018
@Moranic Can you PR the reproducible Unit Test? It will help us diagnose the root cause.
Moranic
@Moranic

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.

bbhxwl
@bbhxwl
Do you have a simple example of calling Pb? If there are Pb files, how to do image recognition?
Adnan Salahuddin
@AdnanSalah84
SciSharp/SciSharp-Stack-Examples#50
I am waiting for this.
Shakerlicious
@Shakerlicious
Hi! Does anyone know how to deal with a TensorflowException where an Op isn't registered in the Tensorflow.NET binary? Trying to load my F-RCNN object detection model in ML.NET and i keep getting this error.
Alawode Oluwandabira
@oluwandabira
In this installation guide where are the prebuilt binaries being referred to?
Haiping
@Oceania2018
Alawode Oluwandabira
@oluwandabira
@Oceania2018 How do I use that link? Opening it in my browser gives an xml document and scrolling through I see a lot of keys for jar files so I'm not sure what I'm looking for
Haiping
@Oceania2018
image.png
Download the appropriate binrary file.
Alawode Oluwandabira
@oluwandabira
Thanks
Alawode Oluwandabira
@oluwandabira
How do I use NumSharp's np.power from f# ? It accepts inref<NDArray> and inref<ValueType> and I'm not sure how to use those in f#