I have a U-Net model with pretrained weights from an Auto-encoder, The Auto-encoder was built an image dataset of 1400 images. I am trying to perform semantic segmentation with 1400 labelled images of a clinical dataset. The model performs well with an iou_score=0.97 on my test image dataset, but when I try to test it on a random image outside
Tag: tensorflow
ValueError: Dimensions must be equal, but are 96 and 256 in tpu on tensorflow
I am trying to create a mnist gan which will use tpu. I copied the gan code from here. Then i made some of my own modifications to run the code on tpu.for making changes i followed this tutorial which shows how to us tpu on tensorflow on tensorflow website. but thats not working and raising an error here is
a bug for tf.keras.layers.TextVectorization when built from saved configs and weights
I have tried writing a python program to save tf.keras.layers.TextVectorization to disk and load it with the answer of How to save TextVectorization to disk in tensorflow?. The TextVectorization layer built from saved configs outputs a vector with wrong length when the arg output_sequence_length is not None and output_mode=’int’. For example, if I set output_sequence_length= 10, and output_mode=’int’, it is
What is meaning of separate ‘bias’ weights stored in Keras model?
Post-edit: Turns out I got confused while constantly playing with the three functions below. model.layer(i).get_weights() returns two separate arrays (without any tags) which are kernel and bias if bias exists in the model. model.get_weights() directly returns all the weights without any tags. model.weights returns weights and a bit of info such as name of the layer it belongs to and
keras – image and label don’t match in ImageDataGenerator.flow_from_directory
I want to classify about 2000 classes image. so I used the ImageDataGenerator, flow_from_directory. I made the main directory and 2000 sub directory. in main directory(test1) in sub directory Each sub directory have 20 images (total about 40k images) And I checked the generator by this script. Then I watched that image don’t match the label ex) a[0][0] has 300th
ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 36, 36, 128), etc
Any idea on what I’m missing? The exception comes up on u6 = concatenate([u6, c4]) I’m using python 3.9.1, my imports involve mainly Keras using a TensorFlow backend. I’ve also tried removing some of the MaxPooling, but that didn’t help, as well as changing some of the MaxPulling variables. My image input is: input_img = Input((300, 300, 1), name=”img”) Answer
How to set a breakpoint inside a custom metric function in keras
I am trying to write my own custom metric functions in keras and I wanted to start with a test function so I implemented a f1_score function using sklearn, next I will need to customize the calculation of the metrics according to my evaluation metrics and therefore I want to set a breakpoint inside the custom metric function to further
Error related to the number of input tensors in Keras
I am inputting series of float32 grayscale images as a list with 16*16 shape to python and try do a regression task with labels inputted from Pandas data frame. Here is the shape of images and df: I used train_test_split from sklearn to split the data to train and test: I am using the following model for doing the prediction,
tf.data: create a Dataset from a list of Numpy arrays of different shape
I have a list of Numpy arrays of different shape. I need to create a Dataset, so that each time an element is requested I get a tensor with the shape and values of the given Numpy array. How can I achieve this? This is NOT working: since you get, as expected: Can’t convert non-rectangular Python sequence to Tensor. p.s.
TypeError: multiple values for argument ‘weight_decay’
I am using an AdamW optimizer that uses cosine decay with a warmup learning scheduler. I have written the custom scheduler from scratch and using the AdamW optimizer provided by the TensorFlow addons library. I get the following error prompt where it says that weight_decay has multiple arguments What is causing problem and how do I resolve this? Answer The