Simultaneous predictions from different models not possible
static SciSharp.Models.IImageClassificationTask[] task = new SciSharp.Models.IImageClassificationTask[2];
static tensorflow tf = new tensorflow();
static SciSharp.Models.ModelWizard wizard = new SciSharp.Models.ModelWizard();
static string _assetsPath = Path.Combine(TFdt.DT.PathAssets, TFdt.DT.PathDataSet);
static string [] Model_Pach = { Path.Combine(_assetsPath, "Model_Camera 1.pb"), Path.Combine(_assetsPath, "Model_Camera 2.pb") };
static public string[] LablePach = { Path.Combine(_assetsPath, "Labels_Camera 1.txt"), Path.Combine(_assetsPath, "Labels_Camera 2.txt") };
static public ModelPredictResult Predict(Image<Bgr, byte> img_bgr ,int ID) {
Mat output = new Mat();
CvInvoke.CvtColor(img_bgr, output, Emgu.CV.CvEnum.ColorConversion.Bgr2Rgb);
var output1 = output.ToImage<Rgb, byte>().Resize(300, 300, Emgu.CV.CvEnum.Inter.Linear);
output1.ToUMat().ConvertTo(output, Emgu.CV.CvEnum.DepthType.Cv32F, 1.0f / 255.0f);
//NDArray imgR = np.array(output.GetData(), TF_DataType.TF_FLOAT);
Tensor tensorr = tf.convert_to_tensor(output.GetData());
var img_final = tf.expand_dims(tensorr, 0);
//predict image
if (task[ID] == null)
{
task[ID]= wizard.AddImageClassificationTask<TransferLearning>(new SciSharp.Models.TaskOptions
{
ModelPath = Model_Pach[ID],
LabelPath = LablePach[ID]
}); ;
}
var result = task[ID].Predict(img_final);
return result;
}
Tensorflow.RuntimeError: 'Current graph is not default graph. Default Graph Key: graph-2/, Current Graph Key: graph-1/'
Have you tried the latest version (0.70.0) ? There was some significant changes to support multi-threading (with one model per thread)

Everything works great with one model. If I add another model for the next prediction I get an error
I use SciSharp.TensorFlow.Redist-Windows-GPU 2.7.0 SciSharp.Models.ImageClassification 0.4.0 TensorFlowSharp 1.15.1 RTX 3080
I can download a small test program https://drive.google.com/file/d/1R57DewCRe66w_CTnHerWuvk76ZKdxkgV/view?usp=sharing
@uzfm I downloaded your sample project, it works well, can't reproduce from my side.

@uzfm I downloaded your sample project, it works well, can't reproduce from my side.
Prediction is good only for the first time. If we make prediction next time we will get error!
Next time the prediction gets an error.
If make a prediction from one model, everything is fine.
I need to make a prediction from different models at the same time.
@uzfm This issue has been fixed, Just upgrade to ImageClassification v0.4.2 and TensorFlow.NET v0.70.1