Exceptions

exception substrafl.exceptions.BatchSizeNotFoundError

Bases: Exception

No batch size found.

exception substrafl.exceptions.CriterionReductionError

Bases: Exception

The criterion reduction must be set to ‘mean’ to use the Newton-Raphson strategy.

exception substrafl.exceptions.DampingFactorValueError

Bases: Exception

The damping factor must be greater than 0 and less than or equal to 1

exception substrafl.exceptions.DatasetSignatureError

Bases: Exception

The __init__() function on the given torch Dataset must have datasamples and is_inference as parameters.

exception substrafl.exceptions.DatasetTypeError

Bases: Exception

The given torch Dataset should be a torch.utils.data.Dataset object and not an instance of it.

exception substrafl.exceptions.EmptySharedStatesError

Bases: Exception

The shared_states is empty. Ensure that the train method of the algorithm returns a StrategySharedState object.

exception substrafl.exceptions.IncompatibleAlgoStrategyError

Bases: Exception

This algo is not compatible with this strategy.

exception substrafl.exceptions.IndexGeneratorSampleNoneError

Bases: Exception

Try to use the index generator without setting the number of samples.

exception substrafl.exceptions.IndexGeneratorUpdateError

Bases: Exception

The index generator has not been updated properly.

exception substrafl.exceptions.InvalidPathError

Bases: Exception

Invalid path.

exception substrafl.exceptions.KeyMetadataError

Bases: Exception

substrafl_version, substra_version and substratools_version keys can’t be added to the experiment metadata.

exception substrafl.exceptions.LenMetadataError

Bases: Exception

Too long additional metadata passed to the execute_experiment function to be shown on the Substra WebApp.

exception substrafl.exceptions.LoadAlgoFileNotFoundError

Bases: Exception

When using the load_algo(), the given folder must contains the following files: algo.tar.gz, metadata.json, the file entered in the local_state_file key of the dictionary.

exception substrafl.exceptions.LoadAlgoLocalDependencyError

Bases: Exception

When using the load_algo(), all dependencies from the local input folder should be install by the user.

exception substrafl.exceptions.LoadAlgoMetadataError

Bases: Exception

When using the load_algo(), the metadata.json file within the folder given as input must contain a local_state_file

exception substrafl.exceptions.MetricFunctionSignatureError

Bases: Exception

The metric_function() function on the given torch Dataset must ONLY have datasamples and predictions_path as parameters.

exception substrafl.exceptions.MetricFunctionTypeError

Bases: Exception

The metric_function() must be of type function.

exception substrafl.exceptions.MultipleTrainTaskError

Bases: Exception

When using the download_algo_files() function in remote mode. The experiment to get the algo files from can’t have multiple TrainDataNodes hosted on the same organization.

exception substrafl.exceptions.NegativeHessianMatrixError

Bases: Exception

Hessian matrix is not positive semi-definite, the problem is not convex

exception substrafl.exceptions.NumUpdatesValueError

Bases: Exception

The num_update has been set to an non-authorize value.

exception substrafl.exceptions.OptimizerValueError

Bases: Exception

The optimizer value is incompatible with the _local_train function.

exception substrafl.exceptions.ScaffoldLearningRateError

Bases: Exception

When using the TorchScaffoldAlgo, a learning rate must be passed to the optimizer.

exception substrafl.exceptions.SharedStatesError

Bases: Exception

Shared states error

exception substrafl.exceptions.SubstraToolsDeprecationWarning

Bases: DeprecationWarning

The substratools version used is deprecated.

exception substrafl.exceptions.TorchScaffoldAlgoParametersUpdateError

Bases: Exception

When using TorchScaffoldAlgo, _scaffold_parameters_update() method must be called once for each update within the _local_train() method.

exception substrafl.exceptions.TrainTaskNotFoundError

Bases: Exception

When using the download_algo_files() function. The provided compute plan must contain a task:

  • hosted by the worker associated to the given client

  • tagged with the given round_idx

exception substrafl.exceptions.UnfinishedTrainTaskError

Bases: Exception

When using the download_algo_files() function. The task to get the algo files from shall be in status STATUS_DONE.

exception substrafl.exceptions.UnsupportedPytorchVersionError

Bases: Exception

Unsupported Pytorch version