Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Why is the wall time from the full trace different from the timer in the compute function?

In my custom operator(runs on cpu), I use butil::Timer to measure the time taken as shown below: void Compute(OpKernelContext* ctx) override { butil::Timer total_timer; total_timer.start(); ...
Mingyue Zhang's user avatar
1 vote
0 answers
20 views

TPU Initialization Fails (OpKernel Missing) Despite Active TPU Runtime in Kaggle

I am facing a persistent issue when trying to initialize the TPU in my notebook. I have already confirmed that: My account is Verified. The Notebook Accelerator is set to TPU. My TPU quota is ...
rezvan gh's user avatar
0 votes
0 answers
21 views

Compatibility between streamlit and protobuf

I am unable to use the print(tf.version.VERSION) to check the tensorflow version. Reason being tensorflow looks for runtime_version in protobuf (from what I have learnt) and that is only supported in ...
sunny's user avatar
  • 683
2 votes
0 answers
40 views

Issue Replicating TF-Lite Conv2D Quantized Inference Output

I am trying to reproduce the exact layer-wise output of a quantized EfficientNet model (TFLite model, TensorFlow 2.17) by re-implementing Conv2D, DepthwiseConv2D, FullyConnected, Add, Mul, Sub and ...
Jolverine's user avatar
-3 votes
0 answers
28 views

Tensorflow GPU use in python 3.13 [duplicate]

Im trying to use tensorflow with gpu on my windows device, i have python 3.13 venv. Is newer version of tensorflow support gou acceleration on windows. Ive read that it stopped in tensorflow version 2....
Med Yassine Ghaoui's user avatar
0 votes
1 answer
82 views

PyInstaller - It does'nt generate an .exe file

I'm using pyinstaller main.spec command. The main.spec file is the next: # -*- mode: python ; coding: utf-8 -*- a = Analysis( ['main.py', 'flujo.py', 'flujo_if.py', 'descarga_manual.py', '...
Paul de la Cruz's user avatar
0 votes
1 answer
34 views

TensorFlow throws cuDNN/cuBLAS/cuFFT and MessageFactory errors on Kaggle

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
0 votes
1 answer
127 views
+200

Why does TFLite INT8 quantization decompose BatchMatMul (from Einsum) into many FullyConnected layers?

I’m debugging a model conversion using onnx2tf and post-training quantization issue involving Einsum, BatchMatMul, and FullyConnected layers across different model formats. Pipeline: ONNX → TF ...
Saurav Rai's user avatar
  • 2,197
Advice
1 vote
0 replies
37 views

Transfer Learning: How do I only save the parameter I trained to save disk space?

So, I am having a transfer learning project using VGG16, however as we all know its model size is over 500MB. I somply don't have enough disk space to save more than 200 instance of said model, ...
Tunglesonag's user avatar
-7 votes
0 answers
69 views

Hi, I wanted to check the script [closed]

VERIFICATION_SCRIPT = os.path.join(paths['APIMODEL_PATH'], 'research', 'object_detection', 'builders', 'model_builder_tf2_test.py') # Verify Installation !python {VERIFICATION_SCRIPT} And after this ...
アオイエゴリイ's user avatar
3 votes
1 answer
59 views

Unable to import_model .h5 in an attemp to try classification because of "BatchNormalization could not be deserialized properly"

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
51 views

Tensor Flow -No attribute Contribute

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
Tooling
1 vote
2 replies
47 views

Is using TRT in Tensorflow 2.18+ possible?

I am aware that TensorFlow has announced that they will no longer support TRT. A while back the announced "Starting with TensorFlow 2.18, support for TensorRT will be dropped. TensorFlow 2.17 ...
Sami Wood's user avatar
  • 605
0 votes
1 answer
88 views

multi output forcast shape prob. with keras.preprocessing.timeseries_dataset_from_array

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
0 votes
1 answer
44 views

How is cosine-similarity loss working together with a masking layer? Visualisation

I have batches containing windows containing embeddings/vectors. To keep it simple let's not assume sentence embeddings (actual case) but 1hot encoded vectors. They are padded. So in the example below ...
Natan's user avatar
  • 1,141
2 votes
1 answer
108 views

Will tf.keras.Sequential containing multiple custom layers be correctly fully serializable and deserializable in my case?

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
156 views

Implementing a LoRA wrapper for Conv2D in Tensorflow

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
114 views

getting a tensor of shape (32,) instead of a single value as a label

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
41 views

what is the purpose of training=True argument? Is it an argument of keras.sequential() or not? [duplicate]

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
3 votes
1 answer
77 views

Tensorflow images guide not working in Google Colab

I'm trying to run the first guide from Tensorflow in Google Colab. I import the dataset with import pathlib dataset_url = "https://storage.googleapis.com/download.tensorflow.org/example_images/...
HONjramiroz98's user avatar
2 votes
0 answers
89 views

ImportError: cannot import name 'model_lib_v2' from 'object_detection'

I'm attempting to train a model on TensorFlow, and I've used Nick's video as reference: https://youtu.be/yqkISICHH-U?si=IYW6Jsqhs0gCwMyc&t=8267 I've experienced following error: Traceback (most ...
Ricardo Wu's user avatar
0 votes
0 answers
23 views

Unable to install tensorflow in mac [duplicate]

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflow
Kapila Shobit's user avatar
1 vote
1 answer
48 views

TensorFlow Custom Training Loop with Mixed Precision Causing NaN Loss After Epoch 15

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
49 views

How to display the basic tensorflow Graph with trace_on() and trace_export() by tensorboard without the 'profiler' error?

I would like to learn the tensorflow. While, when I run the code in my google-colab, I had the error message: 'UnavailableError: Cannot export profiling results. No profiler is running.'. The code is ...
LeiDing's user avatar
  • 31
0 votes
1 answer
235 views

TensorFlow not detecting NVIDIA GPU (RTX 3050, CUDA 12.7, TF 2.20.0) [duplicate]

I’ve been trying to get TensorFlow to use my GPU on Windows, and even though everything seems installed correctly, it shows 0 available GPUs. System setup Windows 11 RTX 3050 Laptop GPU NVIDIA driver ...
Houssem Eddine's user avatar
1 vote
1 answer
69 views

Why GenPareto from Scipy and Tensorflow-Probability show difference?

I'm trying to understand why the Generalized Pareto distribution shows different results for the same parameters. The results from SciPy make sense, while the results from TensorFlow Probability do ...
PPR's user avatar
  • 447
-1 votes
1 answer
37 views

Pretrained ESRGAN (.pb) gives reddish or purple image — is this a preprocessing issue or model issue?

I'm trying to use a pretrained ESRGAN model that I downloaded in .pb format. The model runs without errors, but the output image has a noticeable reddish/purple tint instead of the correct colors. ...
Ahmed Almakki's user avatar
3 votes
0 answers
73 views

@tensorflow-models/face-landmarks-detection no longer works with tfjs. 403 error in network request for model

I get an error while trying to run tfjs. It was working last week but it seems that the url for model is no longer available. Any suggestions for working model url/refactor? import { createDetector, ...
adcprogrammer's user avatar
1 vote
1 answer
268 views

Play Console warning: “Library that does not support 16 KB: base/lib/x86_64/libtensorflowlite_jni.so” when uploading AAB with TensorFlow Lite

I’m uploading my Android App Bundle (AAB) to Google Play Console and getting this warning: Library that does not support 16 KB: base/lib/x86_64/libtensorflowlite_jni.so after upgrading the lib ...
Hossam Sadekk's user avatar
2 votes
1 answer
127 views

ERROR: No matching distribution found for tensorflow==2.12

I use macOS. I have to use LibRecommender in my code. Python Version: 3.8.13 According to this link, the 2.10 is a suitable tensorflow version. This is what's in my requirements.txt file I install ...
xxx's user avatar
  • 11
0 votes
0 answers
66 views

Streamlit app throwing "NotFittedError: idf vector is not fitted" even though TF-IDF pipeline is fitted and works locally

I trained a sentiment classification model using a scikit-learn Pipeline that includes a TfidfVectorizer and LogisticRegression classifier. Everything works perfectly on my local machine, but when I ...
MOSAB FATAH's user avatar
1 vote
1 answer
38 views

Do I need .repeat() or steps_per_epoch when training on a finite TFRecord dataset in Keras?

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

Tensorflow gradient returns None

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
79 views

TensorFlow 2.18.0 (conda-forge) fails on macOS with down_cast assertion in casts.h

For several months, I have encountered this issue but postponed a thorough investigation due to the complexity introduced by multiple intervening layers, such as Positron, Quarto, and Conda. Recently, ...
Marcel Turcotte's user avatar
0 votes
0 answers
119 views

Transforming tensorflow v1 graph and weights into saved model

I defined model (mnist digits recognition) using tensorflow 2.15.0 and tensorflow.compat.v1. Model was **not ** trained and the graph was exported using following code: init = tf....
hekciu's user avatar
  • 11
1 vote
0 answers
106 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 ...
swiss_knight's user avatar
  • 8,381
0 votes
1 answer
110 views

ValueError: Only instances of keras.Layer can be added to a Sequential model when using TensorFlow Hub KerasLayer

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
2 votes
1 answer
123 views

Keras Model throwing Error while integrating with frontend

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
77 views

Multimodel for image captioning with CNN and LSTM over flickr30k does not learn. How to fuse image features and word embeddings?

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
67 views

Mask image in tensorflow

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
-1 votes
1 answer
93 views

How to install a compatible version of TensorFlow Federated on Google Colab (Python 3.12 + TensorFlow 2.19)?

I am using Google Colab, which comes with: Python 3.12.11 TensorFlow 2.19.0 When I try: !pip uninstall -y numpy jax jaxlib !pip install tensorflow_federated Pip starts backtracking and tries to ...
Ms.Bithi's user avatar
-3 votes
1 answer
94 views

Can I visualize a neural network’s loss landscape to see if it’s stuck in a bad minimum? Any code example for this? [closed]

So, I’m trying to understand why sometimes neural networks get stuck during training. I heard people talk about ‘local minima’ and ‘saddle points,’ but I can’t really picture them. I want to actually ...
prithvisyam's user avatar
0 votes
0 answers
79 views

How to load a model while ignoring unbuilt head layers? (`expected 2 variables, received 0`)

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
0 answers
67 views

How do I convert TensorFlow SavedModel into TensorFlow.js format?

I’m trying to convert my TensorFlow SavedModel into a TensorFlow.js format using tensorflowjs_converter. tensorflowjs_converter --input_format=tf_saved_model --output_format=tfjs_graph_model --...
A A's user avatar
  • 19
0 votes
0 answers
71 views

Tensorflow lite sample code does not work from the tutorials

https://ai.google.dev/edge/litert/models/signatures#java I have the model generated, I have the model loaded. I verified this because I can see the signatures that are available: I don't know what ...
Reid Isaki's user avatar
0 votes
0 answers
48 views

How to replace tf.placeholder in TensorFlow 2.x?

I’m learning TensorFlow 2.x and I have some code from TF 1.x: X = tf.placeholder(tf.float32, shape=[None, 784]) Y = tf.placeholder(tf.float32, shape=[None, 10]) When I run this in TF 2.x, I get: ...
A A's user avatar
  • 19
1 vote
3 answers
78 views

Why isn't my keras model throwing and error when different sizes are passed to the dense layer?

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
3 answers
200 views

n_jobs>=2 breaks reproducibility

I am facing a problem in maintaining the reproducibility in the ML project. I believe the core snippet of my issue is clf = Clf(random_state=cfg.seed) # instantiate the K-fold cross-validation ...
Rubem Pacelli's user avatar
0 votes
1 answer
61 views

Firebase Remote Model Downloader not working in android studio

I am following this firebaseML guide from Google, but I was not able to import my firebase custom text classifier model into my android studio. I don't understand why since my model is only 12.5 mb. ...
Arrgina 2657's user avatar

1
2 3 4 5
1645