aimodelshare 0.1.33__py3-none-any.whl → 0.1.34__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.

Potentially problematic release.


This version of aimodelshare might be problematic. Click here for more details.

aimodelshare/aimsonnx.py CHANGED
@@ -647,7 +647,12 @@ def _keras_to_onnx(model, transfer_learning=None,
647
647
  metadata['model_weights'] = pickle.dumps(model.get_weights())
648
648
 
649
649
  # Extract architecture
650
-
650
+ if not model.built: # add shape outputs if model not built
651
+ try:
652
+ model(tf.random.uniform([1] + list(input_shape[1:])))
653
+ except Exception:
654
+ pass # fallback, don't crash conversion
655
+
651
656
  keras_layers = keras_unpack(model)
652
657
  layers = []
653
658
  layers_n_params = []
@@ -657,10 +662,19 @@ def _keras_to_onnx(model, transfer_learning=None,
657
662
  for layer in keras_layers:
658
663
  layers.append(layer.__class__.__name__)
659
664
  layers_n_params.append(layer.count_params())
660
- layers_shapes.append(getattr(layer, 'output_shape', None))
665
+
666
+ shape = getattr(layer, 'output_shape', None)
667
+ if shape is not None:
668
+ try:
669
+ shape = tuple(shape)
670
+ except:
671
+ shape = str(shape)
672
+ layers_shapes.append(shape)
673
+
661
674
  if hasattr(layer, 'activation'):
662
675
  act = getattr(layer.activation, '__name__', None)
663
- if act: activations.append(act)
676
+ if act:
677
+ activations.append(act)
664
678
 
665
679
  optimizer = getattr(model.optimizer, '__class__', None)
666
680
  loss = getattr(model.loss, '__class__', None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aimodelshare
3
- Version: 0.1.33
3
+ Version: 0.1.34
4
4
  Summary: Deploy locally saved machine learning models to a live rest API and web-dashboard. Share it with the world via modelshare.org
5
5
  Home-page: https://www.modelshare.org
6
6
  Author: Michael Parrott
@@ -1,6 +1,6 @@
1
1
  aimodelshare/README.md,sha256=_OMdUIeIYZnpFlKdafM1KNWaANO2nWdx0QpLE_ZC-Qs,2014
2
2
  aimodelshare/__init__.py,sha256=CS0iFxgAic21gBcQE6NSZ-D_ElHw80_A3OWrEYo9Dks,539
3
- aimodelshare/aimsonnx.py,sha256=yNdkaZ2m-FKsr33g7d8M_DtR0ljZ6AxE2Eg8yLOhnXE,67169
3
+ aimodelshare/aimsonnx.py,sha256=3FC5O4NqvOtkFCUKXL8TNKl1dNJYtoa_wi_hNJlCm4Y,67589
4
4
  aimodelshare/api.py,sha256=jeCIMbpBllTYi-bPvCdNvI6yHaT3JYakq9fgaz10s_E,34920
5
5
  aimodelshare/aws.py,sha256=jn99R9-N77Qac-_eYm-LaCQUPd-RnE7oVULm9rh-3RY,15232
6
6
  aimodelshare/aws_client.py,sha256=Ce19iwf69BwpuyyJlVN8z1da3c5jf93svsTgx1OWhaA,6784
@@ -140,11 +140,11 @@ aimodelshare/sam/codepipeline_policies.txt,sha256=267HMXMnbP7qRASkmFZYSx-2HmKf5o
140
140
  aimodelshare/sam/codepipeline_trust_relationship.txt,sha256=yfPYvZlN3fnaIHs7I3ENMMveigIE89mufV9pvR8EQH8,245
141
141
  aimodelshare/sam/spark-class.txt,sha256=chyJBxDzCzlUKXzVQYTzuJ2PXCTwg8_gd1yfnI-xbRw,217
142
142
  aimodelshare/sam/template.txt,sha256=JKSvEOZNaaLalHSx7r9psJg_6LLCb0XLAYi1-jYPu3M,1195
143
- aimodelshare-0.1.33.dist-info/licenses/LICENSE,sha256=JXBYLriXYgTloZs-9CJPZY76dqkuDT5df_HghMnljx8,1134
143
+ aimodelshare-0.1.34.dist-info/licenses/LICENSE,sha256=JXBYLriXYgTloZs-9CJPZY76dqkuDT5df_HghMnljx8,1134
144
144
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
145
145
  tests/test_aimsonnx.py,sha256=-GOF1_qXGQaMxHyqK0GPg7dD1meE-S7CZea4pLmBDTk,3906
146
146
  tests/test_playground.py,sha256=vdFWPRrZNQ2poiBOoN3l7HsXB5yc3p3rrrclNYJHnaw,24574
147
- aimodelshare-0.1.33.dist-info/METADATA,sha256=8lhWr27e-UtqlJ16FIAfw4kTt3HPUI9TkN_wr2Gg7NQ,2916
148
- aimodelshare-0.1.33.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
149
- aimodelshare-0.1.33.dist-info/top_level.txt,sha256=2KJgeHQ0BmZuilB75J203i7W4vri6CON2kdbwk9BNpU,19
150
- aimodelshare-0.1.33.dist-info/RECORD,,
147
+ aimodelshare-0.1.34.dist-info/METADATA,sha256=C8WYQRoE8zPDC4am5ekyiRlQA1GEOcW4_aZyDGSr9m8,2916
148
+ aimodelshare-0.1.34.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
149
+ aimodelshare-0.1.34.dist-info/top_level.txt,sha256=2KJgeHQ0BmZuilB75J203i7W4vri6CON2kdbwk9BNpU,19
150
+ aimodelshare-0.1.34.dist-info/RECORD,,