I load a saved h5 model and want to save the model as pb.
The model is saved during training with the tf.keras.callbacks.ModelCheckpoint callback function.
TF version: 2.0.0a
edit: same issue also with 2.0.0-beta1
My steps to save a pb:
I first…
I want to reuse an convolutional autoencoder (with the mnist datasets with 10 digits/categories) from https://blog.keras.io/building-autoencoders-in-keras.html and put it into a modified version where images are loaded from diretories with…
For certain problems, the validation data can't be a generator, e.g.: TensorBoard histograms:
If printing histograms, validation_data must be provided, and cannot be a generator.
My current code looks like:
image_data_generator =…
I am getting following error
AttributeError: 'list' object has no attribute 'dtype'
when running the following script which uses transfer learning in Keras to retrain and fine tune the last layer in the Inception V3 model. For my dataset I'm…
Any idea about why our training loss is smooth and our validation loss is that noisy (see the link) across epochs? We are implementing a deep learning model for diabetic retinopathy detection (binary classification) using the data set of fundus…
I would like to use different paddings for different dimensions. In my case I'm using a 3dconvnet. The reason is that I would like to control how how the receptive field and axis squashing occurs for different dimensions. E.g. I would like to have…
The acc gyro in model.fit is (200 * 3),in the Input layer shape is (200 * 3). Why is there such a problem? Error when checking input: expected acc_input to have 3 dimensions, but got array with shape (200, 3).This is a visualization of my…
I would like be able to several layers together, but before specifying the input, something like the following:
# conv is just a layer, no application
conv = Conv2D(64, (3,3), activation='relu', padding='same', name='conv')
# this doesn't work:
bn =…
I am trying to concatenate my input with a constant tensor in the keras-2 function API. In my real problem, the constants depend on some parameters in setup, but I think the example below shows the error I get.
from keras.layers import*
from…
I'm trying to replace swish activation with relu activation in pretrained TF model EfficientNetB0. EfficientNetB0 uses swish activation in Conv2D and Activation layers. This SO post is very similar to what I'm looking for. I also found an answer…
I am experimenting with kerastuner.
Here is my code with a reproducible example:
import kerastuner as kt
from kerastuner.tuners.bayesian import BayesianOptimization
(x_train, y_train), (x_test, y_test) =…
It's been days that I've been struggling just to simply view layers' gradients in the debug mode of Keras2. Needless to say, I have already tried codes such as:
import Keras.backend as K
gradients = K.gradients(model.output, model.input)
sess =…
I am trying out something where I required to freeze some selected weights. Take this example
from keras.models import Sequential
from keras.layers import Dense,Input
model = Sequential()
model.add(Dense(4,…
I have created a variational autoencoder in Keras using 2D convolutions for encoder and decoder. The code is shown below. Now, I would like to visualize the individual layers or filters (feature maps) to see what the network learns.
How can this be…
So here is the model with the standard loss function.
target = Input(shape=(1, ), dtype='int32')
w_inputs = Input(shape=(1, ), dtype='int32')
w_emb = Embedding(V, dim, embeddings_initializer='glorot_uniform',name='word_emb')(w_inputs)
w_flat=…