9,815 questions with no answers
1
vote
0
answers
55
views
Make sure all arrays contain the same number of samples
Train_data is a dataset which had been uploaded and I am sure my dataset is okay.
Here is my code:
# Separate features and target labels
X = train_data.drop(['label', 'Id'], axis=1) # Features (...
3
votes
0
answers
134
views
ValueError: Unknown layer: 'CustomScaleLayer'
I am building a model using InceptionResNEtV2 for my image dataset training.
My model looks like:
`inception_resnet = InceptionResNetV2(weights = "imagenet",
...
1
vote
0
answers
102
views
Keras multi gpu memory usage is different
I try to use 4 gpus in my labtop. so i use the command
new_model = multi_gpu_model(model, gpus=4)
It works very well, but there are one problem.
only the first gpu has more gpu memory.
below is my ...
1
vote
0
answers
103
views
How to load a model while ignoring unbuilt head layers? (`expected 2 variables, received 0`)
I’m loading a custom ViT backbone saved via MLflow’s TensorFlow flavor (Keras 3). The artifact includes backbone parts I want (patch_embed, encoder) a couple of layers in the encoder were saved in a ...
Best practices
0
votes
0
replies
103
views
ODIR-5K: Should I train a Dual-Input CNN (Left/Right) or split images for Patient-Level Multi-Label Classification?
I am working with the ODIR-5K (Ocular Disease Intelligent Recognition) dataset. The goal is multi-label classification of 8 ocular diseases (Normal, Diabetes, Glaucoma, Cataract, etc.).
The Data ...
0
votes
0
answers
59
views
Keras to_categorical results in different memory allocation error every re-run
I'm working on a semantic segmentation model through U-net for classifying 11 categories. After splitting my image and label data into training and testing arrays, I turn the arrays into Unsigned ...
0
votes
0
answers
82
views
Is using setattr + list to create a variable number of sublayers serializable?
I am implementing a custom Keras Layer where the number of internal sublayers depends on a user-defined parameter, so I don’t know the number of layers in advance.
To handle this, I create the ...
0
votes
0
answers
75
views
Keras Conv3D input shape clarification: spatial dimensions vs width/height/depth
I'm trying to use Conv3D in Keras and the documentation is a bit confusing regarding the input shape.
The Conv3D docs say:
This layer creates a convolution kernel that is convolved with the layer ...
0
votes
0
answers
63
views
How can AUC be correctly used with a softmax output, sparse integer labels and categorical_crossentropy for binary classification in Keras?
I am working on a binary image classification task using TensorFlow/Keras (TensorFlow version: 2.19.0). My model architecture is a multimodal setup with two input branches (CT and PET scans), and its ...
0
votes
0
answers
107
views
Is my use of tf.distribute.MirroredStrategy and strategy.scope() correct and safe for multi-GPU training in Keras?
I am training a model using Keras + TensorFlow with tf.distribute.MirroredStrategy on a multi-GPU setup. I would like to verify that I am using strategy.scope() correctly.
import time
import logging
...
0
votes
0
answers
74
views
ValueError: An operation has 'None' for gradient. Please make sure that all of your ops have a gradient defined
I keep getting this error with the following code
config_path = 'E:/chinese_roberta_wwm_large_ext_L-24_H-1024_A-16/bert_config.json'
checkpoint_path = 'E:/chinese_roberta_wwm_large_ext_L-24_H-1024_A-...
2
votes
0
answers
775
views
How to use pyinstaller for keras?
I have written just one line in a python code to import keras and then I want to build an executable of this using pyinstaller.
I ran below command to generate executable
pyinstaller --onefile test....
2
votes
0
answers
66
views
Write_grads no more present on latest version of Keras
I'm having some issues with the training of a convolutional neural network, as the loss initially decreases but suddenly it becames nan. I guess the problem could be related to some exploding/...
1
vote
0
answers
71
views
Can I convert .keras model to .h5 so that tensorflow 2.10 can use it for prediction?
I trained a keras sequential model while working in colab. Now I shifted to a PC with Windows 11. jupyter notebook with Tensorflow 2.10 is unable to read that model. it needs a model in the old .h5 ...
1
vote
0
answers
141
views
Unable to load an hdf5 model file in TensorFlow / Keras
I was given an hdf5 model file that was build with tensorflow / keras. Training data is no more available.
Note: all Python code snippets shown hereunder are run against Python 3.9.23 inside a ...