convert .csv to Tensor #2745
Unanswered
ShayanRiyaz
asked this question in
Q&A
Replies: 1 comment
-
Hi @ShayanRiyaz, it's not entirely clear what you want to do. It looks like you want to convert a CSV to a Tensor so you can call ONNX Runtime from C#? If so, you should refer to the ONNX Runtime C# API docs, which includes a link to a sample. I didn't find the docs very helpful -- it looks like the Tensors library is not really mainstream yet -- so you might want to see the source too https://github.com/dotnet/runtime/tree/master/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors. I think the gist of it is: using Microsoft.ML.OnnxRuntime.Tensors;
//..
float[,] values = ReadYour2dCsvHere("file/path.csv");
return values.ToTensor(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I haven't found the relevant documentation for this issue, therefore, I am asking the question over here.
I have a model trained using tensorflow.keras and the model reads CSV files as an input. I have attached the whole process in the zip file along with the model converted to a .onnx file. I'm currently using Unity for a project and I am trying to give my trained .onnx model input of a csv file (in my case it will be a 20,9) file. However, I am unable to understand how to convert the csv file into tensor input in the project.
note: The .csv file is created within the unity project
I found this C# online but it is for a color image
If anyone can help me transform the input or guide me to the relevant documentation, that would be great.
Thank you.
random_files_tensorflow.zip
Beta Was this translation helpful? Give feedback.
All reactions