machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

DllNotFoundException: Unable to load DLL 'tensorflow': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Open yasir9624 opened this issue 6 years ago • 2 comments

I am trying to Consume the ML.NET model to predict the results via following code

public static ModelOutput Predict(ModelInput input) {

        // Create new MLContext
        MLContext mlContext = new MLContext();
        ModelOutput result = new ModelOutput();
        try
        {


            Load model &create prediction engine
            string modelPath = AppDomain.CurrentDomain.BaseDirectory + "MLModel.zip";
            ITransformer mlModel = mlContext.Model.Load(modelPath, out var modelInputSchema);
            var predEngine = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(mlModel);

            Use model to make prediction on input dataDllNotFoundException: Unable to load DLL 'tensorflow': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

            result = predEngine.Predict(input);
            Console.WriteLine(result);

        }
        catch (Exception e)
        {
            Console.WriteLine(e.ToString());
        }
        return result;
    }

I am having tensorflow.dll error while it is installed and present in respective folder too.

yasir9624 avatar Jan 27 '20 06:01 yasir9624

Hi @yasir9624 , are you importing the TensorFlow libraries by adding using Microsoft.ML.TensorFlow before you declare your namespace?

mstfbl avatar Jan 27 '20 12:01 mstfbl

Closing this issue as no response was received.

mstfbl avatar Feb 18 '20 20:02 mstfbl