Open jackpotcityco opened 1 week ago
Which MLNet version are you using.
You can pass a cancellation token/set maximum training time/set maximum models to explores in AutoML.
For cancelling using cancellation token, you can refer to this test sample. You can also find other examples about cancelling under that test class as well.
Note that the current running trial can't be interrupted by cancellation unless it's implemented in managed code. For example, LightGBM trainer can't be interrupted because it's implemented in native code.
Hello,
RAM: 64 GB CPU: i7-12800h
I am trying to understand how to Cancel an experiment but just can't make it work. I have tried both below lines (One at a time, not both at the same time) when:
if (modelsLISTtemp.Count >= 3)
MLContextExtensions.CancelExecution(mlContext); //Cancel experiment using "Microsoft.ML.Experimental
cancellationTokenSource.Cancel(); // Cancel the task running the experiment using: CancellationToken = cts
The first is using
.CancelExecution
from Microsoft.ML.Experimental but the experiment never stops and continues to the end which is more than 4 minutes after the.CancelExecution
attempt.The second is trying the
CancellationToken = cts
but exactly as in above it never stops and continues to the end which is more than 4 minutes after thecancellationTokenSource.Cancel();
attempt.In both, the experiment continues to return 10,20,30+ models during those 4 minutes.
How would it be possible to actually cancel the Experiment on demand to not be stuck with the 300 seconds the experiment runs? (MaxExperimentTimeInSeconds = (uint)300)
_trainData and hold_outdata are populated with data for training when passed to function: testExperiment