We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG][CV] Model Error Analysis - the exception for task OTHER is different than other checks
**Describe the bug**
When running a OTHER task, the Model Error Analysis exception is different from the rest of the checks. Need to standardize it.

**To Reproduce**
Run a "OTHER" task in the model performance suite. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `deepchecks/vision/checks/performance/model_error_analysis.py`
Content:
```
1 # ----------------------------------------------------------------------------
2 # Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)
3 #
4 # This file is part of Deepchecks.
5 # Deepchecks is distributed under the terms of the GNU Affero General
6 # Public License (version 3 or later).
7 # You should have received a copy of the GNU Affero General Public License
8 # along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.
9 # ----------------------------------------------------------------------------
10 #
11 """Module containing class performance check."""
12 import typing as t
13 from collections import defaultdict
14 
15 import pandas as pd
16 import torch
17 
18 from deepchecks.core import CheckResult, DatasetKind
19 from deepchecks.core.errors import DeepchecksValueError
20 from deepchecks.utils.performance.error_model import error_model_display_dataframe, model_error_contribution
21 from deepchecks.utils.single_sample_metrics import per_sample_cross_entropy
22 from deepchecks.vision.utils.image_properties import default_image_properties, validate_properties
23 from deepchecks.vision import TrainTestCheck, Context, Batch
24 from deepchecks.vision.vision_data import TaskType
25 from deepchecks.vision.metrics_utils.iou_utils import per_sample_mean_iou
26 
27 __all__ = ['ModelErrorAnalysis']
28 
29 
30 class ModelErrorAnalysis(TrainTestCheck):
31     """Find the properties that best split the data into segments of high and low model error.
32 
33     The check trains a regression model to predict the error of the user's model. Then, the properties scoring the
34     highest feature importance for the error regression model are selected and the distribution of the error vs the
35     property values is plotted. The check results are shown only if the error regression model manages to predict the
36     error well enough.
37 
38     Parameters
39     ----------
40     image_properties : List[Dict[str, Any]], default: None
41         List of properties. Replaces the default deepchecks properties.
42         Each property is dictionary with keys 'name' (str), 'method' (Callable) and 'output_type' (str),
43         representing attributes of said method. 'output_type' must be one of 'continuous'/'discrete'
44     max_properties_to_show : int , default: 3
45         maximal number of properties to show error distribution for.
46     min_property_contribution : float , default: 0.15
47         minimum feature importance of a property to the error regression model
48         in order to show the property.
49     min_error_model_score : float , default: 0.5
50         minimum r^2 score of the error regression model for displaying the check.
51     min_segment_size : float , default: 0.05
52         minimal fraction of data that can comprise a weak segment.
53     n_display_samples : int , default: 5_000
54         number of samples to display in scatter plot.
55     random_state : int, default: 42
56         random seed for all check internals.
57     """
58 
59     def __init__(self,
60                  image_properties: t.List[t.Dict[str, t.Any]] = None,
61                  max_properties_to_show: int = 20,
62                  min_property_contribution: float = 0.15,
63                  min_error_model_score: float = 0.5,
64                  min_segment_size: float = 0.05,
65                  n_display_samples: int = 5_000,
66                  random_state: int = 42,
67                  **kwargs):
68         super().__init__(**kwargs)
69         self.random_state = random_state
70         self.min_error_model_score = min_error_model_score
71         self.min_segment_size = min_segment_size
72         self.max_properties_to_show = max_properties_to_show
73         self.min_property_contribution = min_property_contribution
74         self.n_display_samples = n_display_samples
75         self._train_properties = None
76         self._test_properties = None
77         self._train_scores = None
78         self._test_scores = None
79 
80         if image_properties is None:
81             self.image_properties = default_image_properties
82         else:
83             validate_properties(image_properties)
84             self.image_properties = image_properties
85 
86     def initialize_run(self, context: Context):
87         """Initialize property and score lists."""
88         self._train_properties = defaultdict(list)
89         self._test_properties = defaultdict(list)
90         self._train_scores = []
91         self._test_scores = []
92 
93     def update(self, context: Context, batch: Batch, dataset_kind):
94         """Accumulate property data of images and scores."""
95         if dataset_kind == DatasetKind.TRAIN:
96             dataset = context.train
97             properties = self._train_properties
98             scores = self._train_scores
99         elif dataset_kind == DatasetKind.TEST:
100             dataset = context.test
101             properties = self._test_properties
102             scores = self._test_scores
103         else:
104             raise RuntimeError(
105                 'Internal Error! Part of code that must '
106                 'be unreacheable was reached.'
107             )
108 
109         images = batch.images
110         predictions = batch.predictions
111         labels = batch.labels
112 
113         for single_property in self.image_properties:
114             properties[single_property['name']].extend(single_property['method'](images))
115 
116         if dataset.task_type == TaskType.CLASSIFICATION:
117             def scoring_func(predictions, labels):
118                 return per_sample_cross_entropy(labels, predictions)
119         elif dataset.task_type == TaskType.OBJECT_DETECTION:
120             def scoring_func(predictions, labels):
121                 return per_sample_mean_iou(predictions, labels)
122         else:
123             raise DeepchecksValueError(f'Unsupported task type {dataset.task_type}')
124 
125         if isinstance(predictions, torch.Tensor):
126             predictions = predictions.cpu().detach().numpy()
127         if isinstance(labels, torch.Tensor):
128             labels = labels.cpu().detach().numpy()
129 
130         # get score using scoring_function
131         scores.extend(scoring_func(predictions, labels))
132 
133     def compute(self, context: Context) -> CheckResult:
134         """Find segments that contribute to model error.
135 
136         Returns
137         -------
138         CheckResult:
139             value: dictionary of details for each property segment that split the effect on the error of the model
140             display: plots of results
141         """
142         # build dataframe of properties and scores
143         train_property_df = pd.DataFrame(self._train_properties).dropna(axis=1, how='all')
144         test_property_df = pd.DataFrame(self._test_properties)[train_property_df.columns]
145 
146         error_fi, error_model_predicted = \
147             model_error_contribution(train_property_df,
148                                      self._train_scores,
149                                      test_property_df,
150                                      self._test_scores,
151                                      train_property_df.columns.to_list(),
152                                      [],
153                                      min_error_model_score=self.min_error_model_score,
154                                      random_state=self.random_state)
155 
156         display, value = error_model_display_dataframe(error_fi,
157                                                        error_model_predicted,
158                                                        test_property_df,
159                                                        [],
160                                                        self.max_properties_to_show,
161                                                        self.min_property_contribution,
162                                                        self.n_display_samples,
163                                                        self.min_segment_size,
164                                                        self.random_state)
165 
166         headnote = """<span>
167             The following graphs show the distribution of error for top properties that are most useful for
168             distinguishing high error samples from low error samples.
169         </span>"""
170         display = [headnote] + display if display else None
171 
172         return CheckResult(value, display=display)
173
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/deepchecks/vision/checks/performance/model_error_analysis.py b/deepchecks/vision/checks/performance/model_error_analysis.py
--- a/deepchecks/vision/checks/performance/model_error_analysis.py
+++ b/deepchecks/vision/checks/performance/model_error_analysis.py
@@ -85,6 +85,7 @@
 
     def initialize_run(self, context: Context):
         """Initialize property and score lists."""
+        context.assert_task_type(TaskType.CLASSIFICATION, TaskType.OBJECT_DETECTION)
         self._train_properties = defaultdict(list)
         self._test_properties = defaultdict(list)
         self._train_scores = []
@@ -120,7 +121,7 @@
             def scoring_func(predictions, labels):
                 return per_sample_mean_iou(predictions, labels)
         else:
-            raise DeepchecksValueError(f'Unsupported task type {dataset.task_type}')
+            raise DeepchecksValueError(f'Should not reach here! Unsupported task type {dataset.task_type}')
 
         if isinstance(predictions, torch.Tensor):
             predictions = predictions.cpu().detach().numpy()

{"golden_diff": "diff --git a/deepchecks/vision/checks/performance/model_error_analysis.py b/deepchecks/vision/checks/performance/model_error_analysis.py\n--- a/deepchecks/vision/checks/performance/model_error_analysis.py\n+++ b/deepchecks/vision/checks/performance/model_error_analysis.py\n@@ -85,6 +85,7 @@\n \n     def initialize_run(self, context: Context):\n         \"\"\"Initialize property and score lists.\"\"\"\n+        context.assert_task_type(TaskType.CLASSIFICATION, TaskType.OBJECT_DETECTION)\n         self._train_properties = defaultdict(list)\n         self._test_properties = defaultdict(list)\n         self._train_scores = []\n@@ -120,7 +121,7 @@\n             def scoring_func(predictions, labels):\n                 return per_sample_mean_iou(predictions, labels)\n         else:\n-            raise DeepchecksValueError(f'Unsupported task type {dataset.task_type}')\n+            raise DeepchecksValueError(f'Should not reach here! Unsupported task type {dataset.task_type}')\n \n         if isinstance(predictions, torch.Tensor):\n             predictions = predictions.cpu().detach().numpy()\n", "issue": "[BUG][CV] Model Error Analysis - the exception for task OTHER is different than other checks\n**Describe the bug**\r\nWhen running a OTHER task, the Model Error Analysis exception is different from the rest of the checks. Need to standardize it.\r\n\r\n**To Reproduce**\r\nRun a \"OTHER\" task in the model performance suite. \n", "before_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\n\"\"\"Module containing class performance check.\"\"\"\nimport typing as t\nfrom collections import defaultdict\n\nimport pandas as pd\nimport torch\n\nfrom deepchecks.core import CheckResult, DatasetKind\nfrom deepchecks.core.errors import DeepchecksValueError\nfrom deepchecks.utils.performance.error_model import error_model_display_dataframe, model_error_contribution\nfrom deepchecks.utils.single_sample_metrics import per_sample_cross_entropy\nfrom deepchecks.vision.utils.image_properties import default_image_properties, validate_properties\nfrom deepchecks.vision import TrainTestCheck, Context, Batch\nfrom deepchecks.vision.vision_data import TaskType\nfrom deepchecks.vision.metrics_utils.iou_utils import per_sample_mean_iou\n\n__all__ = ['ModelErrorAnalysis']\n\n\nclass ModelErrorAnalysis(TrainTestCheck):\n    \"\"\"Find the properties that best split the data into segments of high and low model error.\n\n    The check trains a regression model to predict the error of the user's model. Then, the properties scoring the\n    highest feature importance for the error regression model are selected and the distribution of the error vs the\n    property values is plotted. The check results are shown only if the error regression model manages to predict the\n    error well enough.\n\n    Parameters\n    ----------\n    image_properties : List[Dict[str, Any]], default: None\n        List of properties. Replaces the default deepchecks properties.\n        Each property is dictionary with keys 'name' (str), 'method' (Callable) and 'output_type' (str),\n        representing attributes of said method. 'output_type' must be one of 'continuous'/'discrete'\n    max_properties_to_show : int , default: 3\n        maximal number of properties to show error distribution for.\n    min_property_contribution : float , default: 0.15\n        minimum feature importance of a property to the error regression model\n        in order to show the property.\n    min_error_model_score : float , default: 0.5\n        minimum r^2 score of the error regression model for displaying the check.\n    min_segment_size : float , default: 0.05\n        minimal fraction of data that can comprise a weak segment.\n    n_display_samples : int , default: 5_000\n        number of samples to display in scatter plot.\n    random_state : int, default: 42\n        random seed for all check internals.\n    \"\"\"\n\n    def __init__(self,\n                 image_properties: t.List[t.Dict[str, t.Any]] = None,\n                 max_properties_to_show: int = 20,\n                 min_property_contribution: float = 0.15,\n                 min_error_model_score: float = 0.5,\n                 min_segment_size: float = 0.05,\n                 n_display_samples: int = 5_000,\n                 random_state: int = 42,\n                 **kwargs):\n        super().__init__(**kwargs)\n        self.random_state = random_state\n        self.min_error_model_score = min_error_model_score\n        self.min_segment_size = min_segment_size\n        self.max_properties_to_show = max_properties_to_show\n        self.min_property_contribution = min_property_contribution\n        self.n_display_samples = n_display_samples\n        self._train_properties = None\n        self._test_properties = None\n        self._train_scores = None\n        self._test_scores = None\n\n        if image_properties is None:\n            self.image_properties = default_image_properties\n        else:\n            validate_properties(image_properties)\n            self.image_properties = image_properties\n\n    def initialize_run(self, context: Context):\n        \"\"\"Initialize property and score lists.\"\"\"\n        self._train_properties = defaultdict(list)\n        self._test_properties = defaultdict(list)\n        self._train_scores = []\n        self._test_scores = []\n\n    def update(self, context: Context, batch: Batch, dataset_kind):\n        \"\"\"Accumulate property data of images and scores.\"\"\"\n        if dataset_kind == DatasetKind.TRAIN:\n            dataset = context.train\n            properties = self._train_properties\n            scores = self._train_scores\n        elif dataset_kind == DatasetKind.TEST:\n            dataset = context.test\n            properties = self._test_properties\n            scores = self._test_scores\n        else:\n            raise RuntimeError(\n                'Internal Error! Part of code that must '\n                'be unreacheable was reached.'\n            )\n\n        images = batch.images\n        predictions = batch.predictions\n        labels = batch.labels\n\n        for single_property in self.image_properties:\n            properties[single_property['name']].extend(single_property['method'](images))\n\n        if dataset.task_type == TaskType.CLASSIFICATION:\n            def scoring_func(predictions, labels):\n                return per_sample_cross_entropy(labels, predictions)\n        elif dataset.task_type == TaskType.OBJECT_DETECTION:\n            def scoring_func(predictions, labels):\n                return per_sample_mean_iou(predictions, labels)\n        else:\n            raise DeepchecksValueError(f'Unsupported task type {dataset.task_type}')\n\n        if isinstance(predictions, torch.Tensor):\n            predictions = predictions.cpu().detach().numpy()\n        if isinstance(labels, torch.Tensor):\n            labels = labels.cpu().detach().numpy()\n\n        # get score using scoring_function\n        scores.extend(scoring_func(predictions, labels))\n\n    def compute(self, context: Context) -> CheckResult:\n        \"\"\"Find segments that contribute to model error.\n\n        Returns\n        -------\n        CheckResult:\n            value: dictionary of details for each property segment that split the effect on the error of the model\n            display: plots of results\n        \"\"\"\n        # build dataframe of properties and scores\n        train_property_df = pd.DataFrame(self._train_properties).dropna(axis=1, how='all')\n        test_property_df = pd.DataFrame(self._test_properties)[train_property_df.columns]\n\n        error_fi, error_model_predicted = \\\n            model_error_contribution(train_property_df,\n                                     self._train_scores,\n                                     test_property_df,\n                                     self._test_scores,\n                                     train_property_df.columns.to_list(),\n                                     [],\n                                     min_error_model_score=self.min_error_model_score,\n                                     random_state=self.random_state)\n\n        display, value = error_model_display_dataframe(error_fi,\n                                                       error_model_predicted,\n                                                       test_property_df,\n                                                       [],\n                                                       self.max_properties_to_show,\n                                                       self.min_property_contribution,\n                                                       self.n_display_samples,\n                                                       self.min_segment_size,\n                                                       self.random_state)\n\n        headnote = \"\"\"<span>\n            The following graphs show the distribution of error for top properties that are most useful for\n            distinguishing high error samples from low error samples.\n        </span>\"\"\"\n        display = [headnote] + display if display else None\n\n        return CheckResult(value, display=display)\n", "path": "deepchecks/vision/checks/performance/model_error_analysis.py"}], "after_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\n\"\"\"Module containing class performance check.\"\"\"\nimport typing as t\nfrom collections import defaultdict\n\nimport pandas as pd\nimport torch\n\nfrom deepchecks.core import CheckResult, DatasetKind\nfrom deepchecks.core.errors import DeepchecksValueError\nfrom deepchecks.utils.performance.error_model import error_model_display_dataframe, model_error_contribution\nfrom deepchecks.utils.single_sample_metrics import per_sample_cross_entropy\nfrom deepchecks.vision.utils.image_properties import default_image_properties, validate_properties\nfrom deepchecks.vision import TrainTestCheck, Context, Batch\nfrom deepchecks.vision.vision_data import TaskType\nfrom deepchecks.vision.metrics_utils.iou_utils import per_sample_mean_iou\n\n__all__ = ['ModelErrorAnalysis']\n\n\nclass ModelErrorAnalysis(TrainTestCheck):\n    \"\"\"Find the properties that best split the data into segments of high and low model error.\n\n    The check trains a regression model to predict the error of the user's model. Then, the properties scoring the\n    highest feature importance for the error regression model are selected and the distribution of the error vs the\n    property values is plotted. The check results are shown only if the error regression model manages to predict the\n    error well enough.\n\n    Parameters\n    ----------\n    image_properties : List[Dict[str, Any]], default: None\n        List of properties. Replaces the default deepchecks properties.\n        Each property is dictionary with keys 'name' (str), 'method' (Callable) and 'output_type' (str),\n        representing attributes of said method. 'output_type' must be one of 'continuous'/'discrete'\n    max_properties_to_show : int , default: 3\n        maximal number of properties to show error distribution for.\n    min_property_contribution : float , default: 0.15\n        minimum feature importance of a property to the error regression model\n        in order to show the property.\n    min_error_model_score : float , default: 0.5\n        minimum r^2 score of the error regression model for displaying the check.\n    min_segment_size : float , default: 0.05\n        minimal fraction of data that can comprise a weak segment.\n    n_display_samples : int , default: 5_000\n        number of samples to display in scatter plot.\n    random_state : int, default: 42\n        random seed for all check internals.\n    \"\"\"\n\n    def __init__(self,\n                 image_properties: t.List[t.Dict[str, t.Any]] = None,\n                 max_properties_to_show: int = 20,\n                 min_property_contribution: float = 0.15,\n                 min_error_model_score: float = 0.5,\n                 min_segment_size: float = 0.05,\n                 n_display_samples: int = 5_000,\n                 random_state: int = 42,\n                 **kwargs):\n        super().__init__(**kwargs)\n        self.random_state = random_state\n        self.min_error_model_score = min_error_model_score\n        self.min_segment_size = min_segment_size\n        self.max_properties_to_show = max_properties_to_show\n        self.min_property_contribution = min_property_contribution\n        self.n_display_samples = n_display_samples\n        self._train_properties = None\n        self._test_properties = None\n        self._train_scores = None\n        self._test_scores = None\n\n        if image_properties is None:\n            self.image_properties = default_image_properties\n        else:\n            validate_properties(image_properties)\n            self.image_properties = image_properties\n\n    def initialize_run(self, context: Context):\n        \"\"\"Initialize property and score lists.\"\"\"\n        context.assert_task_type(TaskType.CLASSIFICATION, TaskType.OBJECT_DETECTION)\n        self._train_properties = defaultdict(list)\n        self._test_properties = defaultdict(list)\n        self._train_scores = []\n        self._test_scores = []\n\n    def update(self, context: Context, batch: Batch, dataset_kind):\n        \"\"\"Accumulate property data of images and scores.\"\"\"\n        if dataset_kind == DatasetKind.TRAIN:\n            dataset = context.train\n            properties = self._train_properties\n            scores = self._train_scores\n        elif dataset_kind == DatasetKind.TEST:\n            dataset = context.test\n            properties = self._test_properties\n            scores = self._test_scores\n        else:\n            raise RuntimeError(\n                'Internal Error! Part of code that must '\n                'be unreacheable was reached.'\n            )\n\n        images = batch.images\n        predictions = batch.predictions\n        labels = batch.labels\n\n        for single_property in self.image_properties:\n            properties[single_property['name']].extend(single_property['method'](images))\n\n        if dataset.task_type == TaskType.CLASSIFICATION:\n            def scoring_func(predictions, labels):\n                return per_sample_cross_entropy(labels, predictions)\n        elif dataset.task_type == TaskType.OBJECT_DETECTION:\n            def scoring_func(predictions, labels):\n                return per_sample_mean_iou(predictions, labels)\n        else:\n            raise DeepchecksValueError(f'Should not reach here! Unsupported task type {dataset.task_type}')\n\n        if isinstance(predictions, torch.Tensor):\n            predictions = predictions.cpu().detach().numpy()\n        if isinstance(labels, torch.Tensor):\n            labels = labels.cpu().detach().numpy()\n\n        # get score using scoring_function\n        scores.extend(scoring_func(predictions, labels))\n\n    def compute(self, context: Context) -> CheckResult:\n        \"\"\"Find segments that contribute to model error.\n\n        Returns\n        -------\n        CheckResult:\n            value: dictionary of details for each property segment that split the effect on the error of the model\n            display: plots of results\n        \"\"\"\n        # build dataframe of properties and scores\n        train_property_df = pd.DataFrame(self._train_properties).dropna(axis=1, how='all')\n        test_property_df = pd.DataFrame(self._test_properties)[train_property_df.columns]\n\n        error_fi, error_model_predicted = \\\n            model_error_contribution(train_property_df,\n                                     self._train_scores,\n                                     test_property_df,\n                                     self._test_scores,\n                                     train_property_df.columns.to_list(),\n                                     [],\n                                     min_error_model_score=self.min_error_model_score,\n                                     random_state=self.random_state)\n\n        display, value = error_model_display_dataframe(error_fi,\n                                                       error_model_predicted,\n                                                       test_property_df,\n                                                       [],\n                                                       self.max_properties_to_show,\n                                                       self.min_property_contribution,\n                                                       self.n_display_samples,\n                                                       self.min_segment_size,\n                                                       self.random_state)\n\n        headnote = \"\"\"<span>\n            The following graphs show the distribution of error for top properties that are most useful for\n            distinguishing high error samples from low error samples.\n        </span>\"\"\"\n        display = [headnote] + display if display else None\n\n        return CheckResult(value, display=display)\n", "path": "deepchecks/vision/checks/performance/model_error_analysis.py"}]}