Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
49 views

I am building a text classification system which requires a large preprocessing and training script. The script reads variable-length token sequences and attempts to build a tf.data.Dataset using ...
coderx's user avatar
  • 3
3 votes
1 answer
43 views

I am learning TensorFlow and transfer learning, and I am trying to add a TensorFlow Hub feature extractor to a Keras Sequential model. But I get this error: ValueError: Only instances of keras.Layer ...
Sanjay Jithesh's user avatar
0 votes
1 answer
56 views

I am working on a Kaggle notebook where I am trying to import TensorFlow/Keras to build a simple neural network for tabular data. However, even with Accelerator = None (CPU only), TensorFlow fails ...
Aniket Kaushal's user avatar
3 votes
1 answer
62 views

I've got a very small python script using a Model.h5 which should be loaded in order to classify some pictures. Here's my python script : import tensorflow as tf from os import walk from keras.models ...
Vincent PHILIPPE's user avatar
0 votes
1 answer
58 views

I am trying to duplicate the code found here which says tested with TensorFlow 1.6. I am using TF version 2.20.0 and really don't want to downgrade to 1.6 so I tried: import tensorflow.compat.v1 as tf ...
jbm417's user avatar
  • 1
0 votes
1 answer
103 views

The model was fuctioinnal with only one output, now I try to use multi output forcasting one timestep, but got this error: Epoch 1/10 2025-11-04 16:20:09.341769: W tensorflow/core/framework/op_kernel....
Jonathan Roy's user avatar
2 votes
1 answer
110 views

I am implementing a U-Net variant in TensorFlow/Keras with custom layers. In one of my layers custom layers UPDoubleConv, I have a Sequential self.blocks containing a repeated pattern of UpSampling2D ...
Ahmed's user avatar
  • 105
5 votes
1 answer
166 views

I have recently been trying to port a LoRA for CNN method originally implemented in PyTorch to TensorFlow, but my implementation did not work well, and I require assistance in making it work. My code ...
Mateus Carmo's user avatar
2 votes
2 answers
120 views

when i try to print/plt.tile the label of an image, its printing the tensor(32,) instead of a single label value. When i tried to print before the resizing, it was printing fine. Code: #### # ...
kay_g's user avatar
  • 73
2 votes
0 answers
42 views

What is the purpose of training=True argument in the last line. I called help(tf.keras.Sequential) but could not find anything related to it. Also is it the argument of tf.keras.Sequential() or not ...
kay_g's user avatar
  • 73
1 vote
1 answer
57 views

I am implementing a custom training loop in TensorFlow 2.18 with mixed precision (float16) for a large vision transformer model. The training runs fine for about 15 epochs, but then the loss suddenly ...
M M's user avatar
  • 13
1 vote
1 answer
90 views

I'm trying to use TensorBoard to monitor weights and bias of a two inputs neural network, composed by two independent submodels. I'm using keras==3.11.3 with tensorboard==2.20.0 and this is callback I'...
Luke83's user avatar
  • 117
2 votes
0 answers
62 views

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/...
Luke83's user avatar
  • 117
1 vote
1 answer
38 views

I’m following this tutorial on 3D brain tumor segmentation using MedicAI and Keras In the tutorial: dataset = dataset.batch(batch_size).prefetch(tf.data.AUTOTUNE) The author does not use .repeat(...
Ahmed's user avatar
  • 105
1 vote
0 answers
54 views

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 ...
Sehaj Kaur's user avatar
0 votes
2 answers
63 views

I am being implementing a custom layer that returns both the transformed output and an auxiliary loss term. The forward pass works fine, but when I try to compute gradients, I get None for the main ...
coderx's user avatar
  • 3
1 vote
0 answers
111 views

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 ...
swiss_knight's user avatar
  • 8,381
0 votes
1 answer
118 views

I’m trying to build a Keras Sequential model using a feature extractor from TensorFlow Hub, but I’m running into this error: ValueError: Only instances of `keras.Layer` can be added to a Sequential ...
user31600948's user avatar
1 vote
1 answer
126 views

I trained a model on Colab for my final year project EfficientNetB0. After all the layer training, I tested it and its result was excellent, but now I want to integrate the model to the frontend web ...
Narendra Patne's user avatar
3 votes
0 answers
78 views

I'm working on an image captioning project using a simple CNN + LSTM architecture, as required by the course I'm studying. The full code is available here on GitHub (note: some parts are memory-...
Malihe Mahdavi sefat's user avatar
1 vote
1 answer
73 views

Can I use keras.Layers to build custom layer to mask to whole dataset and return masked dataset. That is class AttnMask(Layer): def __init__(self, img_size, attention_map): super()....
Akira's user avatar
  • 33
0 votes
0 answers
84 views

I’m loading a costume 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 ...
Marzi Heidari's user avatar
1 vote
3 answers
78 views

I am working on a dynamic time series multi-class segmentation problem with keras (tensorflow version 2.12.0), and I wanted to see what would happen when I dropped in a dense layer into the network ...
jjschuh's user avatar
  • 403
0 votes
1 answer
173 views

I am using TensorFlow/Keras to create a deep learning model. The network is built as follows: inps = [] features = [] for i in range(number_windows): inp = Input(shape=(window_length,), name=f&...
CopyOfA's user avatar
  • 931
3 votes
1 answer
212 views

I am trying to implement a TensorFlow dataset from a Python generator because I am having problems with my model consuming memory, inevitably resulting in a OOM crash (see my question on that here). ...
CopyOfA's user avatar
  • 931
0 votes
0 answers
77 views

I am trying to perform KFold cross-validation on a Keras model. The first fold runs exactly as expected, but from the second fold onwards the model doesn’t seem to reset. The training behaves ...
pd_prince's user avatar
2 votes
1 answer
94 views

I have an image dataset where each image has multiple categorical features that I want to predict. I am getting this error when trying to train: ValueError: y_true and y_pred have different structures....
Fish4203's user avatar
2 votes
0 answers
168 views

I am training a model using TensorFlow/Keras using TensorFlow 2.19.0/Keras 3.10.0. During training, I monitor nvidia-smi and top, and the system RAM and the GPU RAM increase during the training period....
CopyOfA's user avatar
  • 931
0 votes
1 answer
69 views

I'm deploying a Keras model using TensorFlow Serving, but the inference time is significantly slower compared to calling model.predict() directly in Python. Running model.predict(input) on a batch of ~...
Jurgita-ds's user avatar
0 votes
1 answer
58 views

When loading the model I am getting: TypeError: too many positional arguments model = load_model(model_path) ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/moo/code/xxx/....
Mikko Ohtamaa's user avatar
-1 votes
1 answer
79 views

I am trying to use Keras' implementation of ResNet50 and adapting it to work on the tiny-imagenet dataset from huggingface. I can use the model to train on the data and collect training and validation ...
Pedro Carvalho's user avatar
0 votes
0 answers
34 views

I have created 3 models (a RF, CNN-LSTM and a MLP) to be deployed in the FRDM MCXN947 microcontroller. They have sizes of 2.18 GB, 7.75 MB and 0.186 MB respectively. I have saved the RF model as ....
min_een's user avatar
0 votes
1 answer
98 views

I was trying to mimic the result of a simple Tensorflow/Keras Dense layer with NumPy (forward pass only) and I was surprised not to have the exact same result. A dense layer output is just the product ...
el_grezeq's user avatar
  • 187
0 votes
0 answers
47 views

I have data where I need to use numpy's get_dummies to convert the One Hot Encoding. When I train from a larger dataset I get all the possible encodings. When I predict I could possible only have a ...
Tim Romero's user avatar
0 votes
2 answers
74 views

I wanted to create a speech recognition application and I was following this tutorial : Transformer ASR. After training it for 1 epoch, I saved the model and it saved successfully: model.save("...
FaisalShakeel's user avatar
0 votes
1 answer
72 views

I have built a CNN model with the following layers: def build_trainable_cnn(input_shape, num_classes): """ Create a CNN model for feature extraction Parameters: ...
remotestbeach's user avatar
0 votes
1 answer
29 views

I'm trying to build and train a model with keras, but I'm facing the error "ValueError: as_list() is not defined on an unknown TensorShape.". Follows the most bare bone code I could build ...
RandomUser's user avatar
2 votes
1 answer
112 views

I'm trying to create a ML model in TensorFlow that takes in a tensor with shape (128,128,12) and outputs a tensor with shape (128,128,3), where the output dimensions mean (x, y, sensor_number). With ...
YPOC's user avatar
  • 731
1 vote
1 answer
54 views

I'm trying to quantize a tfjs model to float16 from the standard float32. This is how I loaded my .keras model and converted it to tfjs. This part works. keras_input_file_path = '/content/cnn_model....
program1232123's user avatar
0 votes
1 answer
66 views

I'm attempting to train a multi-class image classification model based on standardised 128x128 images. When I use "accuracy" alone as a metric, I have no issues. When I introduce AUC, I can'...
Imran Khakoo's user avatar
  • 1,019
2 votes
0 answers
214 views

I am really confused because this should never happen according to common sense and to all things that I found on the internet. In short. My UNet with sigmoid activation as last layer gives ...
Ivan's user avatar
  • 771
1 vote
0 answers
69 views

I am using the model.compile(metrics=[MyMetric]) I was wondering why I only see loss and val_loss, but only se my_metric and not val_my_metric after the evaluation at end of each epoch completes. I ...
Adam's user avatar
  • 1,827
0 votes
1 answer
62 views

I'm using open-images-v7 dataset (accessing via fiftyone lib) and keras_cv lib to fine tune DeepLabV3Plus with mobilenet_v3_small backbone, but the accuracy doesn't improve with epochs at all, and I'm ...
Amir's user avatar
  • 155
1 vote
1 answer
69 views

I'm running a Python script on a VPS in a continuous loop. The script fetches stock data with yfinance, then trains a new TensorFlow/Keras model for each stock. Problem: The process's RAM usage ...
teamPT's user avatar
  • 11
1 vote
0 answers
82 views

I'm trying to read safetensors file in C. As a read on Huggingface's documentation, I'm taking first 8 byte of file for header size; ... uint64_t header_size = 0; int read_header_size = fread(&...
Ömer Faruk Demirel's user avatar
0 votes
0 answers
103 views

Context: I am learning to use tensorflow and want to do a simple experiment where I provide a neural network with 4 color choices for each pixel. The network should learn to pick the best colors from ...
Tomáš Zato's user avatar
0 votes
0 answers
72 views

This question is related to the Distributed hyperparameter tuning strategy of keras tuner to get the possible hyperparameters for my model. The search space is huge. The worker thread is as in the ...
Don Woodward's user avatar
0 votes
1 answer
133 views

I was trying to make a model testing series I ran into some horrible compilation behavior. The model runs about 5x faster on my CPU (Xeon W-2225, 4 core) than on my RTX 3060 (12GB) OR on my T1000 (4GB)...
user30013477's user avatar
0 votes
1 answer
85 views

I am encountering issues importing the applications library to utilize the EfficientNetB0 model in an image classification model training. I have reviewed the TensorFlow documentation, and supposedly, ...
Adri's user avatar
  • 1
1 vote
1 answer
204 views

I am trying to run a gridsearch in my pycharm jupyter notebook. Getting 'super' object has no attribute '__sklearn_tags__' error. This question was asked for RandomizedSearch previously, but none of ...
Don Woodward's user avatar

1
2 3 4 5
843