Hi Folks,
I'm working through the example notebook binary segmentation (camvid).ipynb, and I've made good progress so far. However, I'm encountering an issue when trying to fit the model.
The error seems to be related to a type mismatch between the ground truth (gt) and the predictions (pr), where one is of type float32 and the other is float64. I was wondering if this is related to a version mismatch of the libraries, or if I might be using the wrong versions of the dependencies.
Any insights or guidance? Thanks in advance!
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[77], line 13
1 # # train model
2 # history = model.fit(
3 # #history = model.fit_generator(
(...)
11
12 # Train the model
---> 13 history = model.fit(
14 train_dataloader,
15 steps_per_epoch=len(train_dataloader),
16 epochs=EPOCHS,
17 callbacks=callbacks,
18 validation_data=valid_dataloader,
19 validation_steps=len(valid_dataloader),
20 )
File E:\Devs\pyEnvs_experiments\segmentations\segmentation-Env\Lib\site-packages\keras\src\utils\traceback_utils.py:122, in filter_traceback.<locals>.error_handler(*args, **kwargs)
119 filtered_tb = _process_traceback_frames(e.__traceback__)
120 # To get the full stack trace, call:
121 # `keras.config.disable_traceback_filtering()`
--> 122 raise e.with_traceback(filtered_tb) from None
123 finally:
124 del filtered_tb
File E:\Devs\pyEnvs_experiments\segmentations\segmentation-Env\Lib\site-packages\segmentation_models\metrics.py:54, in IOUScore.__call__(self, gt, pr)
53 def __call__(self, gt, pr):
---> 54 return F.iou_score(
55 gt,
56 pr,
57 class_weights=self.class_weights,
58 class_indexes=self.class_indexes,
59 smooth=self.smooth,
60 per_image=self.per_image,
61 threshold=self.threshold,
62 **self.submodules
63 )
File E:\Devs\pyEnvs_experiments\segmentations\segmentation-Env\Lib\site-packages\segmentation_models\base\functional.py:93, in iou_score(gt, pr, class_weights, class_indexes, smooth, per_image, threshold, **kwargs)
90 axes = get_reduce_axes(per_image, **kwargs)
92 # score calculation
---> 93 intersection = backend.sum(gt * pr, axis=axes)
94 union = backend.sum(gt + pr, axis=axes) - intersection
96 score = (intersection + smooth) / (union + smooth)
TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type float64 of argument 'x'.
Hi Folks, I'm working through the example notebook binary segmentation (camvid).ipynb, and I've made good progress so far. However, I'm encountering an issue when trying to fit the model.
The error seems to be related to a type mismatch between the ground truth (gt) and the predictions (pr), where one is of type float32 and the other is float64. I was wondering if this is related to a version mismatch of the libraries, or if I might be using the wrong versions of the dependencies.
Any insights or guidance? Thanks in advance!
FYI, this my virtual environment 'pip list':