Questions tagged [keras-tuner]
166 questions
1
vote
2 answers
Dealing with highly imbalanced datasets using Tensorflow Dataset and Keras Tuner
I have a highly imbalanced dataset (3% Yes, 87% No) of textual documents, containing a title and abstract feature. I have transformed these documents into tf.data.Dataset entities with padded batches. Now, I am trying to train this dataset using…

rvdinter
- 51
- 3
1
vote
1 answer
Tune a pre-existing model with Keras Tuner
I am looking at Keras Tuner as a way of doing hyperparameter optimization, but all of the examples I have seen show an entirely fresh model being defined. For example, from the Keras Tuner Hello World:
def build_model(hp):
model =…

ChrisM
- 2,128
- 1
- 23
- 41
1
vote
1 answer
View logs from Keras Tuner in Tensorboard
I am tuning a Neural Net with Keras Tuner
I am creating logs this way:
tuner = RandomSearch(
build_model,
objective='val_accuracy',
max_trials=5,
executions_per_trial=3,
directory='my_dir',
project_name='helloworld')
This…

bjornsing
- 322
- 6
- 25
1
vote
1 answer
Model-building function in Keras Tuner did not return a valid Keras Model instance
I am trying to learn CNN following Krish naik Youtube tutorial in one program i am getting this error:
RuntimeError: Model-building function did not return a valid Keras Model instance, found

pysaundary
- 166
- 2
- 13
0
votes
0 answers
Developing a CNN architecture for keras-tuner
I just discovered Keras-Tuner and am trying to use it to tune my CNN's hyperparameters, but it looks like there's a mistake in my function to define the model. Here's my function:
from keras import models, layers, optimizers, losses, metrics …

curious_cosmo
- 1,184
- 1
- 18
- 36
0
votes
0 answers
ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 7732, 3), found shape=(None, 250)
11
I'm working in a project to perform multiclass classification. on Cusing Keras Tensorflow. I'm using the onsumer Finance FRCB dataset.In the first step I create token and embedidings using Keras Tokenizer as follows.
%%time
# prepare text data…
0
votes
0 answers
keras_tuner found dict_keys([]) after using custom Callback function
I have a problem using the Keras tuner for hyperparameter tuning while using a custom callback function. In my callback function I basically want to evaluate every trained model and save some specific evaluation parameters as well as the model at…

Lukas
- 1
- 1
0
votes
0 answers
Does keras_tuner BayesianOptimization warm start?
I used a keras_tuner.BayesianOptimization on particular search space, and it took a while to find the best model.
I'd like to change the search space a bit but allow it to use the previous trials to chose which direction to explore it (given that…

sapo_cosmico
- 6,274
- 12
- 45
- 58
0
votes
0 answers
Key error when printing tuner.summary() from Keras Tuner
In the following code, when the "print(tuner.summary())" line is commented, the code will run without error, although nothing is printed to the screen. When this line is uncommented, I get the error message below.
Code:
import numpy as np
import…

Innocuous Rift
- 61
- 6
0
votes
0 answers
tuning Keras Sequential NN, tuned model doesn't perform well
I am trying to tune my NN hyperparameters.
This was my initial NN:
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(256, activation=tf.nn.tanh, input_shape=[X_train_norm.shape[1]]),
…

shani Friedaman
- 1
- 1
0
votes
1 answer
Tensorflow: Graph of the iterator is different from the graph the dataset was created in
While using the Keras_tuner library I got the error in the title. I have no clue how to fix it and could not find any solutions for some time.
I am using Tensorflow BatchDatasets and passing them for the Hyperparameter tuning.
batch_size =…

Meno
- 1
- 2
0
votes
0 answers
Error in the initialisation of initial layer of Keras Tuner
I'm getting the value error of incompatible shape of tensors of my code. The following is my code :
from tensorflow import keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers…
0
votes
0 answers
Keras-tuner doesn't use the whole training dataset, how can one adjust it?
I'm currently stuck in my masterthesis. I'm trying to do a Bayesian Optimization for the hyperparameter tuning with the Keras-Tuner. I have a training dateset containing 4131 samples, but keras-tuner only uses 130 datapoints for the tuning. I'd like…
0
votes
0 answers
keras tuner difference between max_epochs in hyperband(() and epochs in search()
I am using this in my code:
stop_early = tf.keras.callbacks.EarlyStopping(monitor='loss', patience=3)
tuner = kt.Hyperband(
model_builder,
objective='val_loss',
max_epochs=100,
factor=2,
overwrite=True,
directory=dir,
project_name='x',
…
0
votes
1 answer
Integrate batch size in keras tuner
I am new to Keras and have been using KerasTuner for the hyperparameters. This works very well, but I have not yet managed to tune the batch size.
There is an official way from Keras, which was discussed here:
How to tune the number of epochs and…

AndyEverything
- 23
- 4