quadra 2.2.1__py3-none-any.whl → 2.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
quadra/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2.2.1"
1
+ __version__ = "2.2.2"
2
2
 
3
3
 
4
4
  def get_version():
quadra/main.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import time
2
2
 
3
3
  import hydra
4
+ import matplotlib
4
5
  from omegaconf import DictConfig
5
6
  from pytorch_lightning import seed_everything
6
7
 
@@ -12,6 +13,8 @@ from quadra.utils.validator import validate_config
12
13
  load_envs()
13
14
  register_resolvers()
14
15
 
16
+
17
+ matplotlib.use("Agg")
15
18
  log = get_logger(__name__)
16
19
 
17
20
 
quadra/utils/export.py CHANGED
@@ -7,7 +7,6 @@ from typing import Any, Literal, TypeVar, cast
7
7
  import torch
8
8
  from anomalib.models.cflow import CflowLightning
9
9
  from omegaconf import DictConfig, ListConfig, OmegaConf
10
- from onnxconverter_common import auto_convert_mixed_precision
11
10
  from torch import nn
12
11
 
13
12
  from quadra.models.base import ModelSignatureWrapper
@@ -22,6 +21,7 @@ from quadra.utils.logger import get_logger
22
21
  try:
23
22
  import onnx # noqa
24
23
  from onnxsim import simplify as onnx_simplify # noqa
24
+ from onnxconverter_common import auto_convert_mixed_precision # noqa
25
25
 
26
26
  ONNX_AVAILABLE = True
27
27
  except ImportError:
@@ -385,8 +385,9 @@ def _safe_export_half_precision_onnx(
385
385
  onnx.checker.check_model(onnx_model)
386
386
  return True
387
387
  except Exception as e:
388
- log.debug("Failed to export model with mixed precision with error: %s", e)
389
- return False
388
+ raise RuntimeError(
389
+ "Failed to export model with automatic mixed precision, check your model or disable ONNX export"
390
+ ) from e
390
391
  else:
391
392
  log.info("Exported half precision ONNX model does not contain NaN values, model is stable")
392
393
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quadra
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Deep Learning experiment orchestration library
5
5
  Home-page: https://orobix.github.io/quadra
6
6
  License: Apache-2.0
@@ -235,7 +235,7 @@ On the same dataset we can run a simple SSL training using the BYOL algorithm wi
235
235
  quadra experiment=generic/imagenette/ssl/byol logger=csv
236
236
  ```
237
237
 
238
- BYOL is not the only SSL algorithm available, you can find a list of all the available algorithms under `quadra/experiment/generic/imagenette/ssl` folder.
238
+ BYOL is not the only SSL algorithm available, you can find a list of all the available algorithms under `quadra/configs/experiment/generic/imagenette/ssl` folder.
239
239
 
240
240
 
241
241
  ### Anomaly Detection Training
@@ -248,11 +248,11 @@ quadra experiment=generic/mnist/anomaly/padim logger=csv
248
248
 
249
249
  This will run an anomaly detection considering on of the classes as good (default is the number 9) and the rest as anomalies.
250
250
 
251
- This will make use of the [anomalib](https://github.com/openvinotoolkit/anomalib) library to train the model. Many different algorithms are available, you can find them under `quadra/experiment/generic/mnist/anomaly` folder.
251
+ This will make use of the [anomalib](https://github.com/openvinotoolkit/anomalib) library to train the model. Many different algorithms are available, you can find them under `quadra/configs/experiment/generic/mnist/anomaly` folder.
252
252
 
253
253
  ## Running with Custom Datasets
254
254
 
255
- Each task comes with a default configuration file that can be customized for your needs. Each example experiment we have seen so far uses a default configuration file that can be found under `quadra/experiment/base/<task>/<config_name>.yaml`.
255
+ Each task comes with a default configuration file that can be customized for your needs. Each example experiment we have seen so far uses a default configuration file that can be found under `quadra/configs/experiment/base/<task>/<config_name>.yaml`.
256
256
 
257
257
  Let's see how we can customize the configuration file to run the classification experiment on a custom dataset.
258
258
 
@@ -1,4 +1,4 @@
1
- quadra/__init__.py,sha256=bj3AEzHwe7kkbVQLXh02eIMYTIaEUW3lRpTDkYpFCwM,112
1
+ quadra/__init__.py,sha256=3IxXq2HWhVPGbI13XyFjCXt9xDBgUMxWYixTBEdYtOk,112
2
2
  quadra/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  quadra/callbacks/anomalib.py,sha256=Z0Xx3M9UEMYGY0BpSsqemgQSQ6jAr4SrvlbDg_oG9C8,11913
4
4
  quadra/callbacks/lightning.py,sha256=1OTM6fB7qBVLPWNBAZJOb3B00q0kAxMWkPjTEn9YgF0,20182
@@ -217,7 +217,7 @@ quadra/losses/ssl/idmm.py,sha256=DyECUEBq7eefda4yuza0KQShztaEJaLIYdEgMOKwpXM,114
217
217
  quadra/losses/ssl/simclr.py,sha256=Di8hKeQEnIAyYhEHrm3H-6cw_JQ7-0vqc7dKz8uxBlI,2209
218
218
  quadra/losses/ssl/simsiam.py,sha256=uCCbqU9aYMwNa3re0qkeEK5Iz7Hxi0jAcEc-sCWZ8fc,877
219
219
  quadra/losses/ssl/vicreg.py,sha256=ANvhYJz6iPv1A-OBXgBSrZrDG-1VmPtK1IZDtyFqNHE,2427
220
- quadra/main.py,sha256=xh8n-Sb_D0w_4L6RaGA39-ie3odz6OGHpOu0pEIwR8g,1366
220
+ quadra/main.py,sha256=6ZYKytVvCzQjgP_0QA6-3ICzVppsbRgPjF-csLKv85o,1407
221
221
  quadra/metrics/__init__.py,sha256=HsTK1gxsjp8_MYgA5caa4OK8sXLqtK_tt9wYyjtFnOc,79
222
222
  quadra/metrics/segmentation.py,sha256=jkQzCUz0ibkEoF95-uL-4wwxybs5SAs2VHiT5ZGckso,9451
223
223
  quadra/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -262,7 +262,7 @@ quadra/utils/anomaly.py,sha256=49vFvT5-4SxczsEM2Akcut_M1DDwKlOVdGv36oLTgR0,4067
262
262
  quadra/utils/classification.py,sha256=7Phbywpd1CNzwLM5F7zV9FrzdHGd6EkR6LRTRpkerTc,24882
263
263
  quadra/utils/deprecation.py,sha256=zF_S-yqenaZxRBOudhXts0mX763WjEUWCnHd09TZnwY,852
264
264
  quadra/utils/evaluation.py,sha256=5Occ6ONsjnvMkaFFjohtgSvffxEKfjdvMbxqzgtmiHQ,18538
265
- quadra/utils/export.py,sha256=Dsl470bE7vFDfNJbWeSDFc_LY8VVEY4pFL1rGQFP0hU,20542
265
+ quadra/utils/export.py,sha256=ddTslYMjdm6tYMPZPp-NpLAjUN6jwsgEItTZv2NBx0c,20608
266
266
  quadra/utils/imaging.py,sha256=Cz7sGb_axEmnGcwQJP2djFZpIpGCPFIBGT8NWVV-OOE,866
267
267
  quadra/utils/logger.py,sha256=tQJ4xpTAFKx1g-UUm5K1x7zgoP6qoXpcUHQyu0rOr1w,556
268
268
  quadra/utils/mlflow.py,sha256=7E09JShGm2qO7bLb_8srA_RYdVAudxeDYmX7pMdjoVU,3524
@@ -293,8 +293,8 @@ quadra/utils/validator.py,sha256=eFCGr0ss1gYSpsL31JbsCXPZUMJAI9_H-mGodt6UGsU,466
293
293
  quadra/utils/visualization.py,sha256=UvGHX0dumfjpT_KX3Yc1W2B5sAXXaZZWIwXQAi4sdoQ,15950
294
294
  quadra/utils/vit_explainability.py,sha256=hY0awehj6UkyBhnBlW5uWoJTsBfgow5Nll9fAqrzmMo,13337
295
295
  hydra_plugins/quadra_searchpath_plugin.py,sha256=AAn4TzR87zUK7nwSsK-KoqALiPtfQ8FvX3fgZPTGIJ0,1189
296
- quadra-2.2.1.dist-info/LICENSE,sha256=8cTbQtcWa02YJoSpMeV_gxj3jpMTkxvl-w3WJ5gV_QE,11342
297
- quadra-2.2.1.dist-info/METADATA,sha256=2Y7BAF6SzOVp7kIeF1TEgbJy-8JV-fMJb1S-juZ0ddQ,17585
298
- quadra-2.2.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
299
- quadra-2.2.1.dist-info/entry_points.txt,sha256=sRYonBZyx-sAJeWcQNQoVQIU5lm02cnCQt6b15k0WHU,43
300
- quadra-2.2.1.dist-info/RECORD,,
296
+ quadra-2.2.2.dist-info/LICENSE,sha256=8cTbQtcWa02YJoSpMeV_gxj3jpMTkxvl-w3WJ5gV_QE,11342
297
+ quadra-2.2.2.dist-info/METADATA,sha256=zFQ9_EqPmEXtfYjuH6TLFCfu1zkbOV0v6RN5posMqng,17609
298
+ quadra-2.2.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
299
+ quadra-2.2.2.dist-info/entry_points.txt,sha256=sRYonBZyx-sAJeWcQNQoVQIU5lm02cnCQt6b15k0WHU,43
300
+ quadra-2.2.2.dist-info/RECORD,,
File without changes