Categories
Development

ValueError: No gradients provided for any variable in Tensorflow 2.0, WAE

I am a tensorflow2.0 learner who is trying to reproduce the code of Wasserstein AutoEncoder or Adversarial AutoEncoder and do some interesting based on that on my own. My code below is based on timsainb/tensorflow2-generative-models with some of modifications. import tensorflow as tf import numpy as np import pandas as pd import tensorflow_probability as tfp […]

Categories
Development

Keras CNN issue

I am trying to write a Siamese Network, using Negative Sampling, Code with just 20 examples (positive & Negative included) Each example include 2 images (x1,x2) and an output indicating if the images are same or not image1 image1 1 image1 image2 0 For this i am interested in getting just the last layer, which […]

Categories
Development

A bit different InvalidArgumentError shown whenever I run my script

So, my model is pretty simple like below, and it fits/trains model totally fine at first run. def CAE(input_shape = (144, 144, 3), filters = [32, 64, 128, 10]): model = Sequential() pad3 = ‘same’ model.add(Conv2D(filters[0], (5,5), strides=2, padding=’same’, activation=’relu’, name=’conv1′, input_shape=input_shape)) model.add(Conv2D(filters[1], (5,5), strides=2, padding=’same’, activation=’relu’, name=’conv2′)) model.add(Conv2D(filters[2], (3,3), strides=2, padding=pad3, activation=’relu’, name=’conv3′)) model.add(Flatten()) […]

Categories
Development

ValueError: Error when checking target: expected dense_1 to have 2 dimensions, but got array with shape (68, 50, 50, 50, 1)

I’m trying to build a convolutional network that will work on a 3D voxel grid. I try to add a fully connected layer but get an error: ValueError: Error when checking target: expected dense_1 to have 2 dimensions, but got array with shape (68, 50, 50, 50, 1) How can this be happening when I […]

Categories
Development

Keras layer and Nonetype [on hold]

Edit 2: Well, the problem in this case seems to be that, when creating a custom Keras layer, self.add_weight does not allow a Nonetype input. Keras’ own BatchNormalization function does not seem to allow Nonetype inputs either. According to this article, this code should work; It should provide a functioning Faster RCNN. However, I cannot […]