Closed leblancdavid closed 4 years ago
Would you be able to share your code so we can see what you are doing?
Right now I'm just running the tutorial code (https://docs.microsoft.com/en-us/dotnet/machine-learning/tutorials/image-classification-api-transfer-learning). When I run Evaluate
I notice it takes a long time. How long should it take?
Would you also share your cpu/gpu configuration? It might be normal to me with that inference speed using ResNet or MobileNet on my laptop.
I'm just running on a regular desktop PC. I just wanted to make sure that I had it implemented correctly. If you are getting similar times than that makes sense. Is there an option or parameter selection that improves inference speed?
What versions of the Nugets are you using? Specifically ML.Net?
1.5.0 ML.Net, 1.15.1 TensorFlow
I am not positive whether it should be faster or not, but a couple of thoughts:
1 - The first pass of the image recognition is slower then the subsequent passes. This is due to the tensorflow graph warming up with the first run. Test and see what happens when you run it a second time in the same pipeline.
2 - I have not been able to find any issues causing slowdowns in our code, but I will be finishing up a comparison running the model directly with tensorflow's python api. I'll let you know the results. If our code is slower, then we may have an issue we need to look into. If not, then thats probably the way it is, at least for the models chosen.
I'm guessing it's just the nature of the architecture then. I may just use decision trees or some of the other algorithms to improve the prediction speed. Thank you for your help!
I don't have much experience with DNN (more with traditional machine learning algorithms) so I went through the automated visual inspection tutorial. The training of the 400 subset images is relatively quick. However, the prediction time is incredibly slow. Running the prediction through 400 images took about 90sec using
ResnetV2101
and 10sec usingMobilenetV2
. For my application, I would need it to be about at least 5x to 10x faster (hopefully close to real-time).My question is, am I doing something wrong or is there something I can do to improve prediction speed?
Thank you!