-
Notifications
You must be signed in to change notification settings - Fork 74.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSP Overflow - high pixel values are being clamped when running on DSP #53552
Comments
@aviaisr , |
read an hdf5 keras model and convert to tflite with quantizationimport tensorflow as tf def rep_data_gen0():
def convert_and_quantize(model):
def main_func():
if name == "main":
_trainDataset = tf.data.Dataset.from_tensor_slices(dataPaths['train']) #same for validation model = Unet('mobilenetv2', input_shape=inputShape, encoder_weights='imagenet', encoder_freeze=False, model = utils.set_regularization(model, kernel_regularizer=keras.regularizers.l2(0.001), lr = keras.callbacks.LearningRateScheduler(scheduler) loss = losses.binary_focal_dice_loss checkpoint = keras.callbacks.ModelCheckpoint(weightsPath, monitor='val_loss', verbose=0, callbacks_list = [lr, checkpoint, historyLogger] compileadam = keras.optimizers.Adam(lr=0.01, beta_1=0.9, beta_2=0.999, epsilon=1e-07, decay=0.0, amsgrad=False) model.compile(loss=loss, optimizer=adam) history = model.fit(x=trainDataset, |
Hi,
I trained a keras model to extract gray-level segmentation maps.
I converted the model to TFLite and quantized the model.
The quantized model produces similar results on CPU and DSP HWs, if the values of the pixels are not very high (<<1).
If the maps produce pixel predictions with high values that are closer to 1, it seems that the values are being clamped when running on DSP, unlike in CPU which produces reasonable maps.
I repeated the tests on versions 2.2, 2.4, and 2.7 and all demonstrated the same results.
What can I do to change this?
Should I change the dynamic range of the maps?
The text was updated successfully, but these errors were encountered: