Skip to content
Snippets Groups Projects
Commit cadd07eb authored by Neta Zmora's avatar Neta Zmora
Browse files

Distiller versioning - fix dual version strings

Two strings represented the library version: one in distiller.__init__.py
and one in setup.py.
This can lead to two difference version string values.
The fix: have distiller.__init__.py read the version string from the
package installation.
This assumes that we've installed distiller properly, but we've been
making this assumption for a long time in our code (e.g. how we do
imports of distiller from the `tests` directory).
parent 81d561e0
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ from .thinning import * ...@@ -27,7 +27,7 @@ from .thinning import *
from .knowledge_distillation import KnowledgeDistillationPolicy, DistillationLossWeights from .knowledge_distillation import KnowledgeDistillationPolicy, DistillationLossWeights
from .summary_graph import SummaryGraph, onnx_name_2_pytorch_name from .summary_graph import SummaryGraph, onnx_name_2_pytorch_name
from .early_exit import EarlyExitMgr from .early_exit import EarlyExitMgr
import pkg_resources
import logging import logging
logging.captureWarnings(True) logging.captureWarnings(True)
...@@ -35,7 +35,10 @@ del dict_config ...@@ -35,7 +35,10 @@ del dict_config
del thinning del thinning
# Distiller version # Distiller version
__version__ = "0.4.0-pre" try:
__version__ = pkg_resources.require("distiller")[0].version
except pkg_resources.DistributionNotFound:
__version__ = "Unknown"
def model_find_param_name(model, param_to_find): def model_find_param_name(model, param_to_find):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment