I am trying to fine-tune resnet for multi-class problem. Since my dataset is very unbalanced I would like to use recall as my metric. However, it does not seems to work...
`from kerastuner.applications import HyperResNet
from kerastuner.tuners import RandomSearch, Hyperband
from kerastuner import Objective
Is error still happening? Can you provide a bit more detail on how you prepare your input? What are the shapes of your data? I cannot reproduce the error using some other example datasets I have.
I am trying to fine-tune resnet for multi-class problem. Since my dataset is very unbalanced I would like to use recall as my metric. However, it does not seems to work...
`from kerastuner.applications import HyperResNet from kerastuner.tuners import RandomSearch, Hyperband from kerastuner import Objective
hypermodel = HyperResNet(input_shape=(IMG_SIZE, IMG_SIZE, 3), classes=8)
Tuner
tuner = RandomSearch( hypermodel, metrics=[tf.keras.metrics.Precision(name='specificity'), tf.keras.metrics.Recall(name='sensitivity')], objective= Objective("val_sensitivity", direction="max"), max_trials=10, tune_new_entries=True, executions_per_trial=1, directory='FineTune/Resnet', project_name='Resnet_Lesion_8_1')
Search
tuner.search(train_generator, verbose = 1, epochs=100, shuffle=True, validation_data=val_generator)`
This gives me the error:
Shapes (None, 8) and (None, 1) are incompatible