Skip to content

Commit

Permalink
- small clarification in message on top namespace import
Browse files Browse the repository at this point in the history
Some users were confused by "error" message when importing Calculator like `from pysipfenn import Calculator`, as feedback on missing dependencies for model export was showing up (without throwing an error). This commit should make things more clear.
  • Loading branch information
amkrajewski authored Oct 18, 2023
1 parent 42804b8 commit 53c9816
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pysipfenn/core/modelExporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
from onnxconverter_common import float16
from onnxsim import simplify
except ModuleNotFoundError as e:
print(f'Could not import {e.name}.\n')
print('Dependencies for exporting to CoreML, Torch, and ONNX are not installed by default with pySIPFENN. You need '
'to install pySIPFENN in "dev" mode like: pip install -e "pysipfenn[dev]", or like pip install -e ".[dev]" if'
'you are cloned it. See pysipfenn.org for more details.')
print('Note: Dependencies for exporting to CoreML, Torch, and ONNX are not installed by default with pySIPFENN. You'
' need to install pySIPFENN in "dev" mode like: pip install -e "pysipfenn[dev]", or like pip install -e '
'".[dev]" if you are cloned it. See pysipfenn.org for more details.')


class ONNXExporter:
Expand Down Expand Up @@ -280,4 +279,4 @@ def exportAll(self):
"""Export all loaded models to CoreML format with the export function."""
for model in tqdm(self.calculator.loadedModels):
self.export(model)
print('***** Done exporting all models! *****')
print('***** Done exporting all models! *****')

0 comments on commit 53c9816

Please sign in to comment.