I need to run python neural network script in witch using imports:
from keras.models import Sequential
from keras.layers import Dense
from keras.callbacks import History
from keras.models import load_model
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(7)
import pandas as pd
from sklearn.model_selection import train_test_split
from keras import optimizers
I try to run it using IronPython but this dont worked. IronPython dont recognise keras.models etc... I also try to run it with System.Diagnostic.Process but this solution also dont worked. It run only simple python scripts with some prints.
I need just to execute .py script from .cs class.
I try examples with cmd.exe with run .py script with but they dont worked.
Is there any way to run python neural network script in c# app? It must be very simple.
EDIT: One of my solutions: string fileName =
string fileName="C:/Users/FUJITSU/source/repos/CardiologicClinic_WebApp/CardiologicClinic_WebApp/AI/xd.py";
Process p = new Process();
p.StartInfo = new ProcessStartInfo(@"C:\Users\FUJITSU\PycharmProjects\NIDUC\venv\Scripts\python.exe", fileName);
p.StartInfo.WorkingDirectory = "C:/Users/FUJITSU/source/repos/CardiologicClinic_WebApp/CardiologicClinic_WebApp/AI";
p.Start();
p.WaitForExit();
p.Close();
And error produced:
line 1, in <module>
from keras.models import load_model
ModuleNotFoundError: No module named 'keras'