Skip to content

Commit 1782164

Browse files
Fix super invocations for onnx and tflite backends (#30)
The `super()` calls are using the wrong class name. By doing this, they're skipping the `__init__()` for the actual super class. This breaks calling `predict()` because `self.lock` has not been assigned. The change for the `tflite` backend has been tested. The change for `onnx` has not been tested, but seems correct.
1 parent 7d02594 commit 1782164

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/lobe/backends/onnx/image_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class ONNXImageModel(ONNXModel, ImageBackend):
77
def __init__(self, signature: ImageClassificationSignature):
8-
super(ONNXModel, self).__init__(signature=signature)
8+
super(ONNXImageModel, self).__init__(signature=signature)
99

1010
def gradcam_plusplus(self, image, label=None):
1111
super(ONNXImageModel, self).gradcam_plusplus(image=image, label=label)

src/lobe/backends/tflite/image_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class TFLiteImageModel(TFLiteModel, ImageBackend):
77
def __init__(self, signature: ImageClassificationSignature):
8-
super(TFLiteModel, self).__init__(signature=signature)
8+
super(TFLiteImageModel, self).__init__(signature=signature)
99

1010
def gradcam_plusplus(self, image, label=None):
11-
super(TFLiteModel, self).gradcam_plusplus(image=image, label=label)
11+
super(TFLiteImageModel, self).gradcam_plusplus(image=image, label=label)

0 commit comments

Comments
 (0)