trains/model.py
def connect(self, task):
        """
        Connect current model with a specific task, only supported for preexisting models,

        i.e. not supported on objects created with create_and_connect()
        When running in debug mode (i.e. locally), the task is updated with the model object
        (i.e. task input model is the load_model_id)
        When running remotely (i.e. from a daemon) the model is being updated from the task
        Notice! when running remotely the load_model_id is ignored and loaded from the task object
        regardless of the code

        :param task: Task object
        """
        if self._task != task:
            raise ValueError('Can only connect preexisting model to task, but this is a fresh model')

        if running_remotely() and task.is_main_task():
            self._floating_data.design = _Model._wrap_design(self._task.get_model_config_text())
            self._floating_data.labels = self._task.get_labels_enumeration()
        elif self._floating_data is not None:
            # we copy configuration / labels if they exist, obviously someone wants them as the output base model
            if _Model._unwrap_design(self._floating_data.design):
                task.set_model_config(config_text=self._floating_data.design)
            else:
                self._floating_data.design = _Model._wrap_design(self._task.get_model_config_text())

            if self._floating_data.labels:
                task.set_model_label_enumeration(self._floating_data.labels)
            else:
                self._floating_data.labels = self._task.get_labels_enumeration()

        self.task._save_output_model(self)

        Connect current model with a specific task, only supported for preexisting models,

        i.e. not supported on objects created with create_and_connect()
        When running in debug mode (i.e. locally), the task is updated with the model object
        (i.e. task input model is the load_model_id)
        When running remotely (i.e. from a daemon) the model is being updated from the task
        Notice! when running remotely the load_model_id is ignored and loaded from the task object
        regardless of the code

        :param task: Task object
        
Connect current model with a specific task, only supported for preexisting models,
i.e. not supported on objects created with create_and_connect()
When running in debug mode , the task is updated with the model object

When running remotely  the model is being updated from the task
Notice. when running remotely the load_model_id is ignored and loaded from the task object
regardless of the code
Connect current model with a specific task only supported for preexisting models i . e . not supported on objects created with create_and_connect () When running in debug mode the task is updated with the model object When running remotely the model is being updated from the task Notice . when running remotely the load_model_id is ignored and loaded from the task object regardless of the code
def connect(self, task):
        if self._task != task:
            raise ValueError('Can only connect preexisting model to task, but this is a fresh model')
        if running_remotely() and task.is_main_task():
            self._floating_data.design = _Model._wrap_design(self._task.get_model_config_text())
            self._floating_data.labels = self._task.get_labels_enumeration()
        elif self._floating_data is not None:
            if _Model._unwrap_design(self._floating_data.design):
                task.set_model_config(config_text=self._floating_data.design)
            else:
                self._floating_data.design = _Model._wrap_design(self._task.get_model_config_text())
            if self._floating_data.labels:
                task.set_model_label_enumeration(self._floating_data.labels)
            else:
                self._floating_data.labels = self._task.get_labels_enumeration()
        self.task._save_output_model(self)
def connect ( self , task ) : if self . _task != task : raise ValueError ( 'Can only connect preexisting model to task, but this is a fresh model' ) if running_remotely ( ) and task . is_main_task ( ) : self . _floating_data . design = _Model . _wrap_design ( self . _task . get_model_config_text ( ) ) self . _floating_data . labels = self . _task . get_labels_enumeration ( ) elif self . _floating_data is not None : if _Model . _unwrap_design ( self . _floating_data . design ) : task . set_model_config ( config_text = self . _floating_data . design ) else : self . _floating_data . design = _Model . _wrap_design ( self . _task . get_model_config_text ( ) ) if self . _floating_data . labels : task . set_model_label_enumeration ( self . _floating_data . labels ) else : self . _floating_data . labels = self . _task . get_labels_enumeration ( ) self . task . _save_output_model ( self )
Connect current model with a specific task, only supported for preexisting models,
i.e.
Connect current model with a specific task only supported for preexisting models i . e .
"""
        Connect current model with a specific task, only supported for preexisting models,

        i.e. not supported on objects created with create_and_connect()
        When running in debug mode (i.e. locally), the task is updated with the model object
        (i.e. task input model is the load_model_id)
        When running remotely (i.e. from a daemon) the model is being updated from the task
        Notice! when running remotely the load_model_id is ignored and loaded from the task object
        regardless of the code

        :param task: Task object
        """ # we copy configuration / labels if they exist, obviously someone wants them as the output base model
self
task
None