Data is in a CSV file which includes image path and target (x and y). where x and y belong to [-1 to 1] after scale (in keras becasue there are so many image . I can not load all in X_train like normal). Thank you so much for help! data in csv file Answer I will write here as
Tag: tf.keras
Extracting Transfer learning output from CNN Keras
How to take the intermediate Transfer learning output. ? Eg: Tried: Answer There’s an unresolved issue in Tensorflow on this problem. According to the issue, you need to pass inputs of both outer model and inner model to get the output of inner model.
stacking LSTM layer on top of BERT encoder in Keras
I have been trying to stack a single LSTM layer on top of Bert embeddings, but whilst my model starts to train it fails on the last batch and throws the following error message: This is how I build the model and I honestly cannot figure out what is going wrong here: this is the full output: The code runs
Tensorflow MirroredStrategy halves the 2nd dimension, though shape in the object remains right
I’ve recently tried to use MirroredStrategy for training. The relevant code is: dataset print is: which is in the correct dimension, but I get the following error: which is odd, as the documentation says that the strategy will halve the first dimension not the second, it should split the dataset for 2, along the first axis. Does anyone know what
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
Keras flatten: ValueError: Attempt to convert a value (None) with an unsupported type () to a Tensor
I have the error mentioned in the title, with the following code This sends the following error According to the question asked with the same error it happens when you mix up keras and tf.keras. But i think have defined the imports accordingly, so unless there is a clash between imports or a bad definition of them i do not
Training a single model jointly over multiple datasets in tensorflow
I want to train a single variational autoencoder model or even a standard autoencoder over many datasets jointly (e.g. mnist, cifar, svhn, etc. where all the images in the datasets are resized to be the same input shape). Here is the VAE tutorial in tensorflow which I am using as a starting point: https://www.tensorflow.org/tutorials/generative/cvae. For training the model, I would
ImportError: cannot import name ‘keras_tensor’ from ‘tensorflow.python.keras.engine’
I’m getting this error while loading the tensorflow addons library Answer This error is because you have incompatibility issues between your TensorFlow, Python and tensorflow-addons. Uninstall the tensorflow-addons and install the version based on the table below. Refer the Github repo for more information.
Why is my validation accuracy so much lower when I switch from doing all in-memory learning to a dada generator?
I have a data set that contains 2 columns: 1.) A string column consisting of 21 different letters. 2.) A classification column: Each of these strings is associated with a number from 1-7. Using the following code, I first perform integer encoding. Using this code, I am performing integer and then one-hot encoding all in memory. Then I train my