Questions tagged [keras-tuner]
166 questions
2
votes
1 answer
ValueError: Tensor's shape (26, 400) is not compatible with supplied shape [26, 200]
I am working on training a neural network using keras and keras_tuner for hyper parameter tuning and ran into an error that isn't similar to other questions asked in the website before.
Here's the code that is relevant according to my…

Axell Lim
- 23
- 6
2
votes
1 answer
Keras-Tuner: Is it possible to use test/validation set in the objective/metric function?
Is it possible to score/evaluate the model performance, using keras-tuner, based on the test set instead of the training set? I'm asking this, because as of now, my understanding is that the metric function used as objective in the tuner.search()…

Mangeko Sharingan
- 23
- 4
2
votes
1 answer
Keras Tuner Hyperband - how to set max trials and max epochs?
I have two questions regarding the Keras Tuner Hyperband class (for a regression problem)
tuner = kerastuner.tuners.hyperband.Hyperband(hypermodel,
objective,
max_epochs,
…

barhdi
- 21
- 1
- 2
2
votes
1 answer
Keras Tuner error: All callbacks used during a search should be deep-copyable
I am having difficulties applying any callbacks to Keras Tuner hyperparameter optimsier objects. Here is the code I run:
from keras.callbacks import TensorBoard, EarlyStopping
%load_ext tensorboard
BATCH_SIZE = 32
time_stamp =…

ConsistentC
- 55
- 5
2
votes
2 answers
How can I tune the optimization function with Keras Tuner?
How can I tune the optimization function with Keras Tuner? I want to try SGD, Adam and RMSprop.
I tried:
hp_lr = hp.Choice('learning_rate', values=[1e-2, 1e-3, 1e-4])
hp_optimizer = hp.Choice('optimizer', values=[SGD(learning_rate=hp_lr),…

Filippos Vlahos
- 77
- 2
- 6
2
votes
0 answers
Keras tuner doesn't update best objective
class regressionHyperModel(HyperModel):
def __init__(self, input_shape):
self.input_shape = input_shape
def build(self, hp):
initializer = hp.Choice(name='kernel', values=['variance_scaling', 'constant',
…

Kaizin Park
- 21
- 2
2
votes
2 answers
Mlflow and KerasTuner integration
I am trying to integrate together KerasTuner and Mlflow. I'd like to record the loss at each epoch of each trial of Keras Tuner.
My approach is:
class MlflowCallback(tf.keras.callbacks.Callback):
# This function will be called after each…

Titus Pullo
- 3,751
- 15
- 45
- 65
2
votes
1 answer
Keras tuner is crashing Google Colab Pro
Google Colab Pro crashes and restarts the kernel.
It worked for a while, running three different trials, before it crashed. Since then it crashes immediately.
Here is the code:
import os
import pandas as pd
train_info =…

JKnecht
- 231
- 2
- 16
2
votes
0 answers
Opimization of CNN for Regression Keras Tuner
I am using Keras Tuner to optimize a CNN model for a regression problem. Basicly I have sequences of DNA that I turned into a matrix in order to use them as images to train a CNN model. What I want to predict is a percentage that depends on those…

Alberto Sánchez
- 21
- 3
2
votes
1 answer
Using Keras Tuner for time series split
Is it possible to use Keras tuner for tuning a NN using Time Series Split , similar to sklearn.model_selection.TimeSeriesSplit in sklearn.
For example consider a sample tuner class from…

data_person
- 4,194
- 7
- 40
- 75
2
votes
1 answer
Possible to adjust search space for batch size depending on model size in Keras Tuner?
I'm using Keras similarly to the end-to-end example here- https://keras-team.github.io/keras-tuner/tutorials/subclass-tuner/
Some of the models that are generated are much larger than others, and the larger ones lead to an OOM error that stops the…

JJ101
- 171
- 5
2
votes
1 answer
Keras tuner: mismatch between number of layers used and number of layers reported
Using example from Keras Tuner website, I wrote simple tuning code
base_model = tf.keras.applications.vgg16.VGG16(input_shape=IMG_SHAPE,
include_top=False,
…

nurabha
- 1,152
- 3
- 18
- 42
1
vote
0 answers
KeyError(f"{name} does not exist.") while using keras tuner
I am using the Keras Tuner for optimizing a CNN. I am able to get the optimal values for the filter and kernel size. But when I try to do the same for the pool size it gives me an error:
File "C:\Users\...", line 180, in pp
-optimal learning…

A. Gehani
- 83
- 7
1
vote
0 answers
How to run Keras-tuner with on multiple CPU cores/threads
I have the sample code and want to run the net evaluation in parallel. I have a Desktop with four cores and it can run two threads per core, so I want to have 8 parameter settings running in parallel. The layers/hypermodels are in a different file,…

martin
- 11
- 2
1
vote
1 answer
Cannot Restore Checkpoint without Error Keras Tuner
I'm using Keras Tuner to hyper parameterize my CNN to process EMG data. The code is being run on 4 nvidia gpus and 5 cpus with TensorFlow's mirrored strategy. When I run the tuner, it's able to run through all the trials and each for two epochs.…

Bykaugan
- 99
- 6