Closed
Description
System information
- OS version/distro: Windows 10
- .NET Version (eg., dotnet --info): Azure Functions Runtime 2.7.1948
Issue
-
What did you do?
InvokedPredictionEnginePool.Predict("MyModelName", example)
from multiple threads. -
What happened?
System.ArgumentException: 'An item with the same key has already been added. Key: MyModelName'
-
What did you expect?
Method is thread safe so that multiple named pools cannot be created simultaneously.
Source code / logs
at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException[T](T key)
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at Microsoft.Extensions.ML.PredictionEnginePool
2.GetPredictionEngine(String modelName)
at Microsoft.Extensions.ML.PredictionEnginePoolExtensions.Predict[TData,TPrediction](PredictionEnginePool`2 predictionEnginePool, String modelName, TData example)
Metadata
Metadata
Assignees
Labels
No labels