Closed giuseppe-terrasi closed 4 years ago
Are there any updates on this issue?
I ll take a look, thx
@giuseppe-terrasi I am not able to repro this with the latest code from master branch. I checked that image file is loaded within using{ .... } statement before actual prediction happens (in \machinelearning\src\Microsoft.ML.ImageAnalytics\ImageLoader.cs : TryLoadDataIntoBuffer(..) method). Could you try your code with the latest ML.NET from master branch.
@ganik Sorry for the delay. I created a test solution here. I used both nuget versions 1.4.0 and 1.5.0-preview with the same result. I also tried to compile the source from master branch but I received a compilation error.
Are there any updates on this issue? Due to it I have a lot of temporary images used by this code that I must delete manually after restarting the process. I can give more information if needed. Thanks.
This is not a solution to this issue but I faced the similar issue and ended up using ITransformer.Transform as an workaround for the prediction.
Using PredictionEngine is cleaner but ITransfomer does not seem to lock files.
@ganik Still no updates?
@ganik My customer also encounters this issue. Any update on this ?
@ganik No updates on this ?
@giuseppe-terrasi @konabuta Hi, sorry for delay and thank you for repro solution. I was able to find the rootcause in machinelearning\src\Microsoft.ML.ImageAnalytics\ImageLoader.cs, line 238: dst = new Bitmap(path) { Tag = path }; BitMap locks the file. There are various approaches how to handle this as per: https://stackoverflow.com/questions/4803935/free-file-locked-by-new-bitmapfilepath I ll investigate various solutions and will submit a fix shortly. Thx.
System information
Issue
Source code / logs