id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_79476330 | stackoverflow | MACHINE_LEARNING | How to load small sample of tensorflow_dataset data | How to load small sample of tensorflow_dataset data
I'm trying to play around with a neural network using the "lm1b" dataset in my computer before training a larger model in a cloud machine.
What I'm struggling with is that every time I try to inspect the data or run the LLM through a very small dataset, tensorflow_da... | https://stackoverflow.com/questions/79476330/how-to-load-small-sample-of-tensorflow-dataset-data | tensorflow, tensorflow-datasets | 1,740,765,504 |
se_51079373 | stackoverflow | MACHINE_LEARNING | Automatically save Tensorboard-like plot of loss to image file | Automatically save Tensorboard-like plot of loss to image file
I am currently trying to predict the movement of a particle using a tensorflow premade Estimator (tf.estimator.DNNRegressor).
I want to save an image of the average loss plot, like the one tensorboard displays, into each model's folder.
Tensorboard is pr... | https://stackoverflow.com/questions/51079373/automatically-save-tensorboard-like-plot-of-loss-to-image-file | tensorflow, tensorflow-estimator | 1,530,178,308 |
se_70240506 | stackoverflow | MACHINE_LEARNING | Why is numpy native on M1 Max greatly slower than on old Intel i5? | Why is numpy native on M1 Max greatly slower than on old Intel i5?
I just got my new MacBook Pro with M1 Max chip and am setting up Python. I've tried several combinational settings to test speed - now I'm quite confused. First put my questions here:
Why python run natively on M1 Max is greatly (~100%) slower than on... | https://stackoverflow.com/questions/70240506/why-is-numpy-native-on-m1-max-greatly-slower-than-on-old-intel-i5 | python, numpy, tensorflow, anaconda, apple-m1 | 1,638,760,565 |
se_61585139 | stackoverflow | MACHINE_LEARNING | How can I convert yolo weights to tflite file | How can I convert yolo weights to tflite file
I will use yolo weights in android so I plan to convert yolo weights file to tflite file.
I use this code in anaconda prompt because I downloaded keras library in env.
activate env
python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5
Finally, it did.Saved ... | https://stackoverflow.com/questions/61585139/how-can-i-convert-yolo-weights-to-tflite-file | python, tensorflow, keras, tensorflow-lite, yolo | 1,588,566,070 |
se_78970210 | stackoverflow | MACHINE_LEARNING | Keras Error 'keras.layers' has no attribute 'RandomRotation' | Keras Error 'keras.layers' has no attribute 'RandomRotation'
I am trying to optimize a CNN made with KERAS. For that I wanted to use the KERAS TUNER module. However, when importing the module i get the error message: "AttributeError: module 'tensorflow.keras.layers' has no attribute 'RandomRotation' ".... | https://stackoverflow.com/questions/78970210/keras-error-keras-layers-has-no-attribute-randomrotation | tensorflow, keras, conv-neural-network, keras-layer, keras-tuner | 1,725,981,825 |
se_58368528 | stackoverflow | MACHINE_LEARNING | Py4JJavaError: An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext | Py4JJavaError: An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext
Anyon know Why I keeo getting this error in Jupyter Notebooks??? I've been trying to load my Tensorflow model into Apache Spark vis SparlFlowbut I can't seem to figure out how to get past this error. Any help would be much a... | https://stackoverflow.com/questions/58368528/py4jjavaerror-an-error-occurred-while-calling-none-org-apache-spark-api-java-ja | python, apache-spark, tensorflow, pyspark, jupyter-notebook | 1,571,008,607 |
se_79708948 | stackoverflow | MACHINE_LEARNING | Tensorflow Graph is finalized and cannot be modified | Tensorflow Graph is finalized and cannot be modified
this is my code:
vocals_path = "output/song.wav"
audio_path = vocals_path
from inaSpeechSegmenter import Segmenter
import tensorflow as tf
# Initialize the segmenter
seg = Segmenter()
# Analyze the audio file
segments = seg(vocals_path)
# Print the segments
for s... | https://stackoverflow.com/questions/79708948/tensorflow-graph-is-finalized-and-cannot-be-modified | python, tensorflow | 1,753,094,613 |
se_42061855 | stackoverflow | MACHINE_LEARNING | What is loss exactly? | What is loss exactly?
I'm training the im2txt sample of tensorflow and it outputs the loss:
INFO:tensorflow:global step 2174: loss = 3.6930 (15.83 sec/step)
INFO:tensorflow:global step 2175: loss = 3.6651 (15.52 sec/step)
INFO:tensorflow:global step 2176: loss = 3.5733 (18.25 sec/step)
INFO:tensorflow:global step 217... | https://stackoverflow.com/questions/42061855/what-is-loss-exactly | tensorflow, neural-network | 1,486,363,692 |
se_79485184 | stackoverflow | MACHINE_LEARNING | InvalidArgumentError with tf.data.Dataset.from_generator() at random points during training | InvalidArgumentError with tf.data.Dataset.from_generator() at random points during training
I want to use a python generator with a tf Dataset to extract and preprocess sequences from a (rather large) numpy array, but I keep getting this error at random points during the first epoch of training (anywhere between ~100 ... | https://stackoverflow.com/questions/79485184/invalidargumenterror-with-tf-data-dataset-from-generator-at-random-points-duri | python, tensorflow, keras, tensorflow2.0, tensorflow-datasets | 1,741,134,622 |
se_58346524 | stackoverflow | MACHINE_LEARNING | Faster Kmeans Clustering on High-dimensional Data with GPU Support | Faster Kmeans Clustering on High-dimensional Data with GPU Support
We've been using Kmeans for clustering our logs.
A typical dataset has 10 mill. samples with 100k+ features.
To find the optimal k - we run multiple Kmeans in parallel and pick the one with the best silhouette score. In 90% of the cases we end up wit... | https://stackoverflow.com/questions/58346524/faster-kmeans-clustering-on-high-dimensional-data-with-gpu-support | tensorflow, machine-learning, pyspark, cluster-analysis, k-means | 1,570,817,606 |
se_79718956 | stackoverflow | MACHINE_LEARNING | Confused about how tf.keras.Sequential works in TensorFlow – especially activation and input_shape | Confused about how tf.keras.Sequential works in TensorFlow – especially activation and input_shape
I'm learning TensorFlow to build machine learning models in Python. I tried following the official documentation on creating a simple classification model, but I couldn't clearly understand the tf.keras.Sequential functi... | https://stackoverflow.com/questions/79718956/confused-about-how-tf-keras-sequential-works-in-tensorflow-especially-activati | python, arrays, tensorflow, sparse-matrix, tf.keras | 1,753,806,775 |
se_62864731 | stackoverflow | MACHINE_LEARNING | ModelCheckpoint not saving the hdf5 file | ModelCheckpoint not saving the hdf5 file
I am encountering an issue while building a speech-to-text model.
After model training, when I try to save the model as a hdf5 file (for future reuse), the operation does not work, and there are no errors popping up in the console.
Here is the full code:
import os
import libros... | https://stackoverflow.com/questions/62864731/modelcheckpoint-not-saving-the-hdf5-file | tensorflow, keras, speech-recognition, speech-to-text, librosa | 1,594,577,042 |
se_75433717 | stackoverflow | MACHINE_LEARNING | module 'keras.utils.generic_utils' has no attribute 'get_custom_objects' when importing segmentation_models | module 'keras.utils.generic_utils' has no attribute 'get_custom_objects' when importing segmentation_models
I am working on google colab with the segmentation_models library. It worked perfectly the first week using it, but now it seems that I can't import the library anymore. Here is the error message... | https://stackoverflow.com/questions/75433717/module-keras-utils-generic-utils-has-no-attribute-get-custom-objects-when-im | python, tensorflow, keras, google-colaboratory, image-segmentation | 1,676,278,482 |
se_67457480 | stackoverflow | MACHINE_LEARNING | How to get the accuracy per epoch or step for the huggingface.transformers Trainer? | How to get the accuracy per epoch or step for the huggingface.transformers Trainer?
I'm using the huggingface Trainer with BertForSequenceClassification.from_pretrained("bert-base-uncased") model.
Simplified, it looks like this:
model = BertForSequenceClassification.from_pretrained("bert-base-uncased")
tokenizer = Ber... | https://stackoverflow.com/questions/67457480/how-to-get-the-accuracy-per-epoch-or-step-for-the-huggingface-transformers-train | python, tensorflow, logging, huggingface-transformers | 1,620,561,921 |
se_79680151 | stackoverflow | MACHINE_LEARNING | v6e TPU-VM with tensorflow cannot initialize in proper | v6e TPU-VM with tensorflow cannot initialize in proper
I am trying to access tpu to train my model, but the tpu-vm can't find or recognizing v6e tpu unit on vm anyway.
This is my command to request a tpu vm:
gcloud compute tpus tpu-vm create test123 --zone=us-central1-b --version=tpu-vm-tf-2.{x}.{y}-pjrt --accelerator... | https://stackoverflow.com/questions/79680151/v6e-tpu-vm-with-tensorflow-cannot-initialize-in-proper | tensorflow, tpu, google-cloud-tpu | 1,750,926,403 |
se_79713620 | stackoverflow | MACHINE_LEARNING | How to set up non-linear (sinusoidal) multiple variable regression problems for tensorflow? | How to set up non-linear (sinusoidal) multiple variable regression problems for tensorflow?
I have some parameters: A1, A2, A3, f1, f2, f3.
These parameters are then used to generate a set of sinusoidal data, something like:
y = A1 * sin(f1 * x) + A2 * sin(f2 * x) + A3 * sin(f3 * x)
From this, I have generated n samp... | https://stackoverflow.com/questions/79713620/how-to-set-up-non-linear-sinusoidal-multiple-variable-regression-problems-for | python, pandas, tensorflow, non-linear-regression | 1,753,370,902 |
se_79704338 | stackoverflow | MACHINE_LEARNING | Tensorflow dataset running out of data durin training | Tensorflow dataset running out of data durin training
I'm creating a dataset from a csv file containing path-names to image locations and mask-locations (xtr and ytr). Initially, the csv contains approx. 1000 elements. Each image is loaded from cloud space and then split using flat_map into 4 or 8 images depending on ... | https://stackoverflow.com/questions/79704338/tensorflow-dataset-running-out-of-data-durin-training | python, tensorflow, tensorflow-datasets | 1,752,731,613 |
se_77219703 | stackoverflow | MACHINE_LEARNING | QAT using TF2 and MobileNetV3-large for full integer quantization | QAT using TF2 and MobileNetV3-large for full integer quantization
I have a Google Colab file where I am attempting to transfer learn and fine tune a MobileNetV3-Large model for binary classification, followed by full integer quantization. My goal is to run the model on the Coral TPU USB accelerator which I have attach... | https://stackoverflow.com/questions/77219703/qat-using-tf2-and-mobilenetv3-large-for-full-integer-quantization | tensorflow, tensorflow2.0, tensorflow-lite, mobilenet | 1,696,307,882 |
se_59888227 | stackoverflow | MACHINE_LEARNING | How should metrics be added to a multi-headed TensorFlow estimator? | How should metrics be added to a multi-headed TensorFlow estimator?
I previously created metrics for a TensorFlow Classifier referencing predictions['logits'] to calculate the metrics. I have changed the model from a Classifier to an Estimator in order to enable multi-objective learning (using MultiHead). However, thi... | https://stackoverflow.com/questions/59888227/how-should-metrics-be-added-to-a-multi-headed-tensorflow-estimator | python, tensorflow, machine-learning, metrics | 1,579,820,314 |
se_79709978 | stackoverflow | MACHINE_LEARNING | Keras ResNet model trains but does not evaluate | Keras ResNet model trains but does not evaluate
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 metrics without much trouble, but when I try to test it the model simp... | https://stackoverflow.com/questions/79709978/keras-resnet-model-trains-but-does-not-evaluate | python, tensorflow, machine-learning, keras, resnet | 1,753,165,017 |
se_79098495 | stackoverflow | MACHINE_LEARNING | How can I solve dimensional of time series problem in TensorFlow? | How can I solve dimensional of time series problem in TensorFlow?
I am trying to train a Feed Forward NN but when I fit the model then says "None values not supported", I already check data and not have NaN or Null, my timeseries is a Stock timeseries so dont have any other dimension than price.
model = Sequential()
m... | https://stackoverflow.com/questions/79098495/how-can-i-solve-dimensional-of-time-series-problem-in-tensorflow | python, tensorflow, time-series, stock | 1,729,174,337 |
se_79706912 | stackoverflow | MACHINE_LEARNING | Tensorflow GPU acceleration but not for Deep Learning tasks | Tensorflow GPU acceleration but not for Deep Learning tasks
I am a mathematician. I am doing some work on simulating probability distribution draws, but there are lots of calculations involved in terms of numerical integration, function inversion. All of this can be vectorized to "speed it up", but I was wondering if ... | https://stackoverflow.com/questions/79706912/tensorflow-gpu-acceleration-but-not-for-deep-learning-tasks | python, tensorflow, probability | 1,752,896,025 |
se_79698151 | stackoverflow | MACHINE_LEARNING | GradientTape won't calculate gradients after restoring a model from ModelCheckpoint | GradientTape won't calculate gradients after restoring a model from ModelCheckpoint
I'm training a CNN on Tensorflow for binary classification and executing my code in Google Colab.
CNN_model = tf.keras.Sequential([
tf.keras.layers.Input(shape=(IMAGE_SIZE, IMAGE_SIZE, 3)),
tf.keras.layers.Conv2D(filters=32... | https://stackoverflow.com/questions/79698151/gradienttape-wont-calculate-gradients-after-restoring-a-model-from-modelcheckpo | python, tensorflow, deep-learning, conv-neural-network, google-colaboratory | 1,752,228,041 |
se_79706005 | stackoverflow | MACHINE_LEARNING | Difference between Tensorflow/Keras Dense Layer output and matmul operation with weights with NumPy | Difference between Tensorflow/Keras Dense Layer output and matmul operation with weights with NumPy
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 between the input ... | https://stackoverflow.com/questions/79706005/difference-between-tensorflow-keras-dense-layer-output-and-matmul-operation-with | python, numpy, tensorflow, keras | 1,752,832,439 |
se_46568913 | stackoverflow | MACHINE_LEARNING | Tensorflow import error: No module named 'tensorflow' | Tensorflow import error: No module named 'tensorflow'
I installed TensorFlow on my Windows Python 3.5 Anaconda environment
The validation was successful (with a warning)
(tensorflow) C:\>python
Python 3.5.3 |Intel Corporation| (default, Apr 27 2017, 17:03:30) [MSC v.1900 64 bit (AMD64)] on win32
Type "help... | https://stackoverflow.com/questions/46568913/tensorflow-import-error-no-module-named-tensorflow | python, windows, tensorflow, installation, anaconda | 1,507,131,620 |
se_37788672 | stackoverflow | MACHINE_LEARNING | How do I specify the number of CPU cores bazel uses? | How do I specify the number of CPU cores bazel uses?
I am building syntaxnet (tensorflow fork) with bazel. It's working very slowly and keeps hanging up.
The last time I had this problem (with caffe) someone told me to change the number of cores I was using by adding -j4. In bazel this command did not work. Any cust... | https://stackoverflow.com/questions/37788672/how-do-i-specify-the-number-of-cpu-cores-bazel-uses | tensorflow, bazel, syntaxnet | 1,465,817,361 |
se_79680467 | stackoverflow | MACHINE_LEARNING | How to handle loss function with sparse output | How to handle loss function with sparse output
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 my training data I have the problem that my output is very sparse, meanin... | https://stackoverflow.com/questions/79680467/how-to-handle-loss-function-with-sparse-output | python, tensorflow, keras, loss-function | 1,750,939,887 |
se_79680627 | stackoverflow | MACHINE_LEARNING | ValueError: The layer sequential_4 has never been called and thus has no defined input | ValueError: The layer sequential_4 has never been called and thus has no defined input
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:
input_shape: shape of input features (e.g., (500, ... | https://stackoverflow.com/questions/79680627/valueerror-the-layer-sequential-4-has-never-been-called-and-thus-has-no-defined | python, tensorflow, keras, deep-learning, conv-neural-network | 1,750,945,934 |
se_59134865 | stackoverflow | MACHINE_LEARNING | Tensorflow : How to optimize trained model size? | Tensorflow : How to optimize trained model size?
I am building a simple TensorFlow model where I am fine-tuning the Elmo model using Tf-Hub module.
I am getting a good result but the problem is when I am saving the model, It's very large where the same time I built the same model in Keras and it's in Kb.
My input da... | https://stackoverflow.com/questions/59134865/tensorflow-how-to-optimize-trained-model-size | python, tensorflow, machine-learning, keras, deep-learning | 1,575,274,424 |
se_73496946 | stackoverflow | MACHINE_LEARNING | VSCode Autocomplete And Suggestion (IntelliSense) Doesn't Work For Tensorflow And Keras Libraries? | VSCode Autocomplete And Suggestion (IntelliSense) Doesn't Work For Tensorflow And Keras Libraries?
The VSCode autocomplete option doesn't work for tensorflow and keras libraries; However i've installed python and pylance extension on it; is there any solution to make it work or not, without install new extension o... | https://stackoverflow.com/questions/73496946/vscode-autocomplete-and-suggestion-intellisense-doesnt-work-for-tensorflow-an | python, tensorflow, visual-studio-code, keras | 1,661,495,733 |
se_79334421 | stackoverflow | MACHINE_LEARNING | Tensorflow dataset splitted sizing parameter problem: Local rendezvous is aborting with status: OUT_OF_RANGE: End of sequence | Tensorflow dataset splitted sizing parameter problem: Local rendezvous is aborting with status: OUT_OF_RANGE: End of sequence
Pretty new with data generator and dataset from tensorflow. I struggle with sizing batch, epochs and step... I can't figure the good set up to remove error "Local rendezvous is aborting with st... | https://stackoverflow.com/questions/79334421/tensorflow-dataset-splitted-sizing-parameter-problem-local-rendezvous-is-aborti | python, tensorflow, tensorflow-datasets | 1,736,199,846 |
se_79539553 | stackoverflow | MACHINE_LEARNING | Tensorflow Probability: Normal Distribution: log_prob Incompatible shapes | Tensorflow Probability: Normal Distribution: log_prob Incompatible shapes
I am working on TF Probability tutorials and working on a 2D grid approximation for mu, sigma of Normal distribution. I am trying to understand to what level I should expect broadcasting to work for the following code:
import tensorflow as tf
i... | https://stackoverflow.com/questions/79539553/tensorflow-probability-normal-distribution-log-prob-incompatible-shapes | tensorflow, tensorflow-probability | 1,743,094,413 |
se_78814724 | stackoverflow | MACHINE_LEARNING | Can't detect GPU with cuDNN 8.6 and CUDA 11.8 | Can't detect GPU with cuDNN 8.6 and CUDA 11.8
I am trying to use TensorFlow with my NVIDIA GeForce RTX 4090 GPU on Windows 11. I installed CUDA 11.8 and cuDNN 8.6 but TensorFlow fails to detect the GPU and computations are performed on the CPU.
Latest NVIDIA drivers were installed. Verified using nvidia-smi.
Down... | https://stackoverflow.com/questions/78814724/cant-detect-gpu-with-cudnn-8-6-and-cuda-11-8 | python, tensorflow, gpu, windows-11 | 1,722,407,355 |
se_79696941 | stackoverflow | MACHINE_LEARNING | Custom TFJS layer no trainable variables found during training | Custom TFJS layer no trainable variables found during training
I made a custom layer in TensorFlow.js that consists of sublayers but not weights of its own. Here is a simplified example
import * as tf from "@tensorflow/tfjs";
import { LayerArgs } from "@tensorflow/tfjs-layers/dist/engine/topology";
import { Kwargs } f... | https://stackoverflow.com/questions/79696941/custom-tfjs-layer-no-trainable-variables-found-during-training | tensorflow, machine-learning, tensorflow.js | 1,752,145,110 |
se_79587417 | stackoverflow | MACHINE_LEARNING | Why does TimeDistributed(Flatten()) raise an InvalidArgumentError when reshaping works? | Why does TimeDistributed(Flatten()) raise an InvalidArgumentError when reshaping works?
I'm building a lip-reading model using tensorflow.keras and getting an error when applying TimeDistributed(Flatten()) after my Conv3D layers. Here's a simplified version of my model architecture:
CODE
from tensorflow.keras.models i... | https://stackoverflow.com/questions/79587417/why-does-timedistributedflatten-raise-an-invalidargumenterror-when-reshaping | tensorflow, keras, conv-neural-network, tensorflow2.0, flatten | 1,745,354,742 |
se_79554842 | stackoverflow | MACHINE_LEARNING | keras_hub ImportError: _pywrap_tensorflow_internal, failure in DLL | keras_hub ImportError: _pywrap_tensorflow_internal, failure in DLL
import keras_hub
In library:
try:
from tensorflow.python._pywrap_tensorflow_internal import *
except ModuleNotFoundError:
pass
(pywrap_tensorflow.py)
err:
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load ... | https://stackoverflow.com/questions/79554842/keras-hub-importerror-pywrap-tensorflow-internal-failure-in-dll | tensorflow, keras, dll | 1,743,755,563 |
se_78974373 | stackoverflow | MACHINE_LEARNING | Error ParallelMapDatasetV2 when trying to predict a model using Keras | Error ParallelMapDatasetV2 when trying to predict a model using Keras
I'm trying to train a simple classification model using Keras that works with text and has two output classification: 0 or 1. I transformed my text data using TfidVectorizer() from SKlearn and everything ran well, until I tried to predict using the ... | https://stackoverflow.com/questions/78974373/error-parallelmapdatasetv2-when-trying-to-predict-a-model-using-keras | python, tensorflow, keras, sparse-matrix, tfidfvectorizer | 1,726,065,473 |
se_79667798 | stackoverflow | MACHINE_LEARNING | Keras AUC metric breaking on a multi-class problem | Keras AUC metric breaking on a multi-class problem
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't train the model.
model = tf.keras.Sequential([
tf.keras.layers.Rescaling... | https://stackoverflow.com/questions/79667798/keras-auc-metric-breaking-on-a-multi-class-problem | python, tensorflow, keras, deep-learning, roc | 1,750,084,552 |
se_79695574 | stackoverflow | MACHINE_LEARNING | unable to load a model with Keras | unable to load a model with Keras
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("model_1_epoch.keras")
But when I tried to load the model again:
custom_objects = {
'Tok... | https://stackoverflow.com/questions/79695574/unable-to-load-a-model-with-keras | python, tensorflow, machine-learning, keras, recurrent-neural-network | 1,752,062,034 |
se_72226652 | stackoverflow | MACHINE_LEARNING | I want train a set of weight using pytorch, but the weights do not even change | I want train a set of weight using pytorch, but the weights do not even change
I want to reproduce a method from a paper, the code in this paper was written in tensorflow1.0 and I want to rewrite it in pytorch. A brief description, I want to get a set of G that can be used to reweight input data but in training, the G... | https://stackoverflow.com/questions/72226652/i-want-train-a-set-of-weight-using-pytorch-but-the-weights-do-not-even-change | tensorflow, pytorch | 1,652,430,896 |
se_78385667 | stackoverflow | MACHINE_LEARNING | Why do I keep getting this Tensorflow related message in Selenium errors? | Why do I keep getting this Tensorflow related message in Selenium errors?
I'm new to Selenium, and I've been trying to write some scripts for web scraping but sometimes when I make a mistake as part of the error message I see this line:
"Created TensorFlow Lite XNNPACK delegate for CPU."
for example in the latest erro... | https://stackoverflow.com/questions/78385667/why-do-i-keep-getting-this-tensorflow-related-message-in-selenium-errors | python, tensorflow, selenium-webdriver, selenium-chromedriver | 1,714,058,748 |
se_79692058 | stackoverflow | MACHINE_LEARNING | Using pd.from_dummies to get the values in target variable back (after one-hot encoding) but getting Value Error | Using pd.from_dummies to get the values in target variable back (after one-hot encoding) but getting Value Error
I'm participating in the curent Kaggle playground series and I decided to use a neural network for the binary classification problem because I am practicing making simple ones. I converted the target variab... | https://stackoverflow.com/questions/79692058/using-pd-from-dummies-to-get-the-values-in-target-variable-back-after-one-hot-e | python, pandas, tensorflow, valueerror, one-hot-encoding | 1,751,832,007 |
se_69970319 | stackoverflow | MACHINE_LEARNING | ValueError: Exception encountered when calling layer "sequential_5" (type Sequential) | ValueError: Exception encountered when calling layer "sequential_5" (type Sequential)
I am following this course :
TensorFlow Developer Certificate in 2022: Zero to Mastery
This is the following code :
# Set random seed
tf.random.set_seed(42)
# Create some regression data
X_regression = np.arange(0, 1000, ... | https://stackoverflow.com/questions/69970319/valueerror-exception-encountered-when-calling-layer-sequential-5-type-sequen | python, tensorflow, machine-learning, keras, deep-learning | 1,636,958,653 |
se_76839159 | stackoverflow | MACHINE_LEARNING | Transport endpoint is not connected in Colab Pro+ | Transport endpoint is not connected in Colab Pro+
I am a google colab pro+ user. I am trying to train a DL model and getting an error of "Transport endpoint is not connected", while training the model. I ve been using the pro version previously and faced the same error so I thought of upgrading but it didnt help as we... | https://stackoverflow.com/questions/76839159/transport-endpoint-is-not-connected-in-colab-pro | python, tensorflow, deep-learning, google-colaboratory | 1,691,184,140 |
se_40980035 | stackoverflow | MACHINE_LEARNING | Can a model trained on gpu used on cpu for inference and vice versa? | Can a model trained on gpu used on cpu for inference and vice versa?
I was wondering if a model trained on the GPU could be use to run inference with the cpu ?
(And vice versa)
Thanks to you! | https://stackoverflow.com/questions/40980035/can-a-model-trained-on-gpu-used-on-cpu-for-inference-and-vice-versa | tensorflow | 1,480,959,246 |
se_50425365 | stackoverflow | MACHINE_LEARNING | Tensorflow populating placeholder with an array | Tensorflow populating placeholder with an array
I am having difficulty populating a placeholder with a tensor. I've searched but can only find values with single values being supplied into the computation graph.
Here's my code:
import tensorflow as tf
import numpy as np
features = [ [0,0], [0,1], [1,0], [1,1] ]
label... | https://stackoverflow.com/questions/50425365/tensorflow-populating-placeholder-with-an-array | python-3.x, tensorflow | 1,526,733,383 |
se_64967293 | stackoverflow | MACHINE_LEARNING | How to train a keras (TensorFlow) model in Java? | How to train a keras (TensorFlow) model in Java?
I've searched how to achieve train a keras or TensorFlow model in Java but failed to proper example. There are lots of documents that describes the load the model in java-client but there is rarely documents that explain the both train and test the model in the java-sid... | https://stackoverflow.com/questions/64967293/how-to-train-a-keras-tensorflow-model-in-java | java, tensorflow, keras | 1,606,129,833 |
se_70697470 | stackoverflow | MACHINE_LEARNING | ValueError: Unrecognized model in ./MRPC/. Should have a `model_type` key in its config.json, or contain one of the following strings in its name | ValueError: Unrecognized model in ./MRPC/. Should have a `model_type` key in its config.json, or contain one of the following strings in its name
Goal: Amend this Notebook to work with Albert and Distilbert models
Kernel: conda_pytorch_p36. I did Restart & Run All, and refreshed file view in working directory.
Error o... | https://stackoverflow.com/questions/70697470/valueerror-unrecognized-model-in-mrpc-should-have-a-model-type-key-in-its | python, tensorflow, huggingface-transformers, bert-language-model, onnx | 1,642,080,735 |
se_79673750 | stackoverflow | MACHINE_LEARNING | Quantizing tfjs model to float16 ValueError: Missing output_path argument | Quantizing tfjs model to float16 ValueError: Missing output_path argument
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.keras'
tfjs_model_dir = '/content/tfjs_cnn_mode... | https://stackoverflow.com/questions/79673750/quantizing-tfjs-model-to-float16-valueerror-missing-output-path-argument | python, tensorflow, keras, tensorflow.js | 1,750,439,501 |
se_79554870 | stackoverflow | MACHINE_LEARNING | tensorflow warnings, please anyone who could resolve? | tensorflow warnings, please anyone who could resolve?
When I import tensorflow I get the following errors?
2025-04-04 14:12:24.786845: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WA... | https://stackoverflow.com/questions/79554870/tensorflow-warnings-please-anyone-who-could-resolve | python, linux, tensorflow, ubuntu, warnings | 1,743,756,374 |
se_79619561 | stackoverflow | MACHINE_LEARNING | Tensorflow: Using Masking in Combination with Concatenate Layer | Tensorflow: Using Masking in Combination with Concatenate Layer
I am trying to use masking in combination with a concatenation layer. So I have one input (jet), that is padded and masked. I want to concatenate to it another input (lepton) which is passed through a RepertVector()-layer. After the concatenation, an LSTM... | https://stackoverflow.com/questions/79619561/tensorflow-using-masking-in-combination-with-concatenate-layer | python, tensorflow, machine-learning | 1,747,136,427 |
se_79384698 | stackoverflow | MACHINE_LEARNING | How can I create TFRecords with a dictionary of multiple 2D Tensors and read them back without parsing errors? | How can I create TFRecords with a dictionary of multiple 2D Tensors and read them back without parsing errors?
I have looked at other posts e.g. Tensorflow TFRecord: Can't parse serialized example to try and resolve the issue of parsing serialized data failures but cannot see where I'm misunderstanding the conversion ... | https://stackoverflow.com/questions/79384698/how-can-i-create-tfrecords-with-a-dictionary-of-multiple-2d-tensors-and-read-the | python, tensorflow, tfrecord | 1,737,729,402 |
se_79686337 | stackoverflow | MACHINE_LEARNING | Dataset from generator in tensorflow error GetNextFromShard | Dataset from generator in tensorflow error GetNextFromShard
I have a train step for a Vertex AI pipeline that uses a template code for setting up distributed training. When fitting any model I get a message in the first epoch indicating the following message:
025-07-01 17:55:35.569062: I tensorflow/core/framework/loca... | https://stackoverflow.com/questions/79686337/dataset-from-generator-in-tensorflow-error-getnextfromshard | python, tensorflow, tensorflow-datasets, google-cloud-vertex-ai | 1,751,386,272 |
se_78906762 | stackoverflow | MACHINE_LEARNING | PyTorch TensorBoard SummaryWriter giving empty metrics | PyTorch TensorBoard SummaryWriter giving empty metrics
I've been setting up tensorboard with PyTorch. Originally I was using lightning, and ran into an issue where I would log my hyperparameter, but the metrics in the HPARAMS tab would be empty. So, to pin point the issue I moved over to the simplest possible example ... | https://stackoverflow.com/questions/78906762/pytorch-tensorboard-summarywriter-giving-empty-metrics | python, tensorflow, pytorch, tensorboard, tensorboardx | 1,724,430,047 |
se_79396213 | stackoverflow | MACHINE_LEARNING | Using an input layer as a weight to a second input layer | Using an input layer as a weight to a second input layer
I have two inputs structures where each feature in the second input uses the values of input 1 to calculate each of the features. Then the second input layer is then connected to the hidden layers and finally to a single output layer. So lets say I have in the f... | https://stackoverflow.com/questions/79396213/using-an-input-layer-as-a-weight-to-a-second-input-layer | tensorflow, machine-learning, keras, neural-network | 1,738,142,254 |
se_53451728 | stackoverflow | MACHINE_LEARNING | n-dimensional sliding window operation in python using gpu accelerated libraries, preferably Tensorflow? | n-dimensional sliding window operation in python using gpu accelerated libraries, preferably Tensorflow?
I am looking for a gpu-accelerated n-dimensional sliding window operation implementation in Python using Tensorflow. You can post your implementation in Torch, Caffe or Theano, but I'll choose the Tensorflow implem... | https://stackoverflow.com/questions/53451728/n-dimensional-sliding-window-operation-in-python-using-gpu-accelerated-libraries | python, tensorflow, image-processing, computer-vision | 1,542,999,296 |
se_79328497 | stackoverflow | MACHINE_LEARNING | Why do I get AttributeError: module 'tensorflow.keras.backend' has no attribute 'placeholder' when using ART's KerasClassifier with TensorFlow 2.x? | Why do I get AttributeError: module 'tensorflow.keras.backend' has no attribute 'placeholder' when using ART's KerasClassifier with TensorFlow 2.x?
I’m trying to use the Adversarial Robustness Toolbox (ART) with a simple Keras model in TensorFlow 2.x, but I’m encountering the following error:
Attri... | https://stackoverflow.com/questions/79328497/why-do-i-get-attributeerror-module-tensorflow-keras-backend-has-no-attribute | python, tensorflow, machine-learning, tf.keras, adversarial-attack | 1,735,980,399 |
se_77635776 | stackoverflow | MACHINE_LEARNING | How to export tflite model maker model_spec for offline usage? | How to export tflite model maker model_spec for offline usage?
I'm using a tflite model maker efficientdet_lite3 model for object detection.
The basic set up goes like this:
import numpy as np
import os
from tflite_model_maker.config import ExportFormat, QuantizationConfig
from tflite_model_maker import model_spec
fro... | https://stackoverflow.com/questions/77635776/how-to-export-tflite-model-maker-model-spec-for-offline-usage | python, tensorflow, tensorflow-lite, tflite | 1,702,229,999 |
se_79680469 | stackoverflow | MACHINE_LEARNING | ValueError: as_list() is not defined on an unknown TensorShape. Error with lambda function | ValueError: as_list() is not defined on an unknown TensorShape. Error with lambda function
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 that still shows the issue:
import numpy... | https://stackoverflow.com/questions/79680469/valueerror-as-list-is-not-defined-on-an-unknown-tensorshape-error-with-lambd | tensorflow, keras | 1,750,939,959 |
se_47855185 | stackoverflow | MACHINE_LEARNING | How can I use 100% of VRAM on a secondary GPU from a single process on windows 10? | How can I use 100% of VRAM on a secondary GPU from a single process on windows 10?
This is on windows 10 computer with no monitor attached to the Nvidia card.
I've included output from nvida-smi showing > 5.04G was available.
Here is the tensorflow code asking it to allocate just slightly more than I had seen previou... | https://stackoverflow.com/questions/47855185/how-can-i-use-100-of-vram-on-a-secondary-gpu-from-a-single-process-on-windows-1 | tensorflow, cuda, windows-10, nvidia | 1,513,514,455 |
se_75643726 | stackoverflow | MACHINE_LEARNING | On windows11, nvcc cannot show the correct version of CUDA | On windows11, nvcc cannot show the correct version of CUDA
The version I originally installed is 11.6. To match the tensorflow2.11.0, I had to install the v11.2 of CUDA, during which I first uinstall the newer version of CUDA(every thing about it) and then install the earlier version that is 11.2. However, after the a... | https://stackoverflow.com/questions/75643726/on-windows11-nvcc-cannot-show-the-correct-version-of-cuda | python, tensorflow, cuda, nvidia, cudnn | 1,678,033,952 |
se_76793069 | stackoverflow | MACHINE_LEARNING | tensorflow 2.10 vs 2.12, same training script, same data, significantly worse training for 2.12 | tensorflow 2.10 vs 2.12, same training script, same data, significantly worse training for 2.12
I use this code https://www.kaggle.com/code/ritvik1909/masked-autoencoder-vision-transformer to train a network a transformer autoencoder. If I use the code under tensorflow 2.10, I obtain way better results than if I use 2... | https://stackoverflow.com/questions/76793069/tensorflow-2-10-vs-2-12-same-training-script-same-data-significantly-worse-tr | python, tensorflow, tensorflow2.0, updates, self-attention | 1,690,625,316 |
se_78530756 | stackoverflow | MACHINE_LEARNING | error : Only instances of `keras.Layer` can be added to a Sequential model | error : Only instances of `keras.Layer` can be added to a Sequential model
I simply want to wrap the model as a keras layer but it simply is not happening ans keeps showing this error to me, i don't know if it's the keras or tensorflow version but i don't want to change them so is there an alternative?
This is the cod... | https://stackoverflow.com/questions/78530756/error-only-instances-of-keras-layer-can-be-added-to-a-sequential-model | python, tensorflow, keras, tensorflow-hub, mobilenet | 1,716,586,045 |
se_77537786 | stackoverflow | MACHINE_LEARNING | How do I use python version 3.7.1 in Kaggle | How do I use python version 3.7.1 in Kaggle
I'm trying to train a tensorflow ML model scripted in python version 3.7.1. However the python version in kaggle is 3.10.2. Is there any method through which I can use a python 3.7 environment and is it possible to make it the default env? | https://stackoverflow.com/questions/77537786/how-do-i-use-python-version-3-7-1-in-kaggle | python, tensorflow, machine-learning, kaggle | 1,700,750,978 |
se_79641155 | stackoverflow | MACHINE_LEARNING | CNN predicts constant values for sparse amplitude regression — can't learn true pixel values | CNN predicts constant values for sparse amplitude regression — can't learn true pixel values
I’m training a small CNN (code below) to predict sparse amplitude maps from binary masks.
Input: 60×60 image with exactly 15 pixels set to 1, rest are 0.
Target: Same size, 0 everywhere except those 15 pixels, which have... | https://stackoverflow.com/questions/79641155/cnn-predicts-constant-values-for-sparse-amplitude-regression-cant-learn-true | tensorflow, machine-learning, deep-learning, pytorch, conv-neural-network | 1,748,377,627 |
se_76176401 | stackoverflow | MACHINE_LEARNING | How to interpret output tensor from YOLOv8 web model? | How to interpret output tensor from YOLOv8 web model?
I am using YOLOv8 for object detection in a React app, and I'm having trouble interpreting the output of the model. I have taken the official "yolov8n.pt" model from Ultralytics and converted it to a web model in python like this:
model = YOLO("yolov8n.pt") # load... | https://stackoverflow.com/questions/76176401/how-to-interpret-output-tensor-from-yolov8-web-model | tensorflow, object-detection, yolo, tensorflow.js, yolov8 | 1,683,225,495 |
se_55366503 | stackoverflow | MACHINE_LEARNING | Problems (cannot) installing/uninstalling Tensorflow | Problems (cannot) installing/uninstalling Tensorflow
I'm trying to update a new version of the TensorFlow but first I want to remove the oldest version by doing the following command:
pip uninstall tensorflow
But I receive the following message:
Skipping tensorflow as it is not installed.
But When I run the ... | https://stackoverflow.com/questions/55366503/problems-cannot-installing-uninstalling-tensorflow | python, python-3.x, tensorflow, pip | 1,553,635,894 |
se_79672094 | stackoverflow | MACHINE_LEARNING | Tensorflow speed of tf.nn.conv2D used instead of opencv GaussianBlur | Tensorflow speed of tf.nn.conv2D used instead of opencv GaussianBlur
I'm trying to move some computer vision tasks to tensorflow. The most intensive ops are convolutions, like GaussianBlur. The timings I get using timeit suggest that the GPU equivalent is >10 x slower.
The stdout reports "WARNING:tensorflow:AutoGraph... | https://stackoverflow.com/questions/79672094/tensorflow-speed-of-tf-nn-conv2d-used-instead-of-opencv-gaussianblur | python, tensorflow, opencv, neural-network, convolution | 1,750,338,284 |
se_79656139 | stackoverflow | MACHINE_LEARNING | tf.keras: Why my UNet with final layer Conv3D with sigmoid activation gives probabilities less than 0 and more than 1 | tf.keras: Why my UNet with final layer Conv3D with sigmoid activation gives probabilities less than 0 and more than 1
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 probabiliti... | https://stackoverflow.com/questions/79656139/tf-keras-why-my-unet-with-final-layer-conv3d-with-sigmoid-activation-gives-prob | python, tensorflow, keras, deep-learning | 1,749,223,643 |
se_59499764 | stackoverflow | MACHINE_LEARNING | tensorflow (not tensorflow-gpu): failed call to cuInit: UNKNOWN ERROR (303) | tensorflow (not tensorflow-gpu): failed call to cuInit: UNKNOWN ERROR (303)
My Test
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
My Error
2019-12-27 10:51:17.887009: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1... | https://stackoverflow.com/questions/59499764/tensorflow-not-tensorflow-gpu-failed-call-to-cuinit-unknown-error-303 | python, tensorflow | 1,577,444,334 |
se_35451948 | stackoverflow | MACHINE_LEARNING | Clarification on tf.Tensor.set_shape() | Clarification on tf.Tensor.set_shape()
I have an image that is 478 x 717 x 3 = 1028178 pixels, with a rank of 1. I verified it by calling tf.shape and tf.rank.
When I call image.set_shape([478, 717, 3]), it throws the following error.
"Shapes %s and %s must have the same rank" % (self, other))
ValueError: Shapes (?... | https://stackoverflow.com/questions/35451948/clarification-on-tf-tensor-set-shape | tensorflow | 1,455,699,463 |
se_70356867 | stackoverflow | MACHINE_LEARNING | SolverProblemError on install Tensorfow with poetry | SolverProblemError on install Tensorfow with poetry
when i add tensoflow with poetry (poetry add tensorflow) i get this error :
Using version ^2.7.0 for tensorflow
Updating dependencies
Resolving dependencies... (0.8s)
SolverProblemError
The current project's Python requirement (>=3.6,<4.0) is not compatible w... | https://stackoverflow.com/questions/70356867/solverproblemerror-on-install-tensorfow-with-poetry | python, tensorflow, python-poetry | 1,639,525,483 |
se_79668288 | stackoverflow | MACHINE_LEARNING | libtensorflow_framework.so.2: cannot enable executable stack as shared object requires: Invalid argument | libtensorflow_framework.so.2: cannot enable executable stack as shared object requires: Invalid argument
I installed tensorflow 2.15.0 and it can't import, with the error:
libtensorflow_framework.so.2: cannot enable executable stack as shared object requires: Invalid argument
It's mentioned here that it can be fixed ... | https://stackoverflow.com/questions/79668288/libtensorflow-framework-so-2-cannot-enable-executable-stack-as-shared-object-re | tensorflow, debian, conda | 1,750,111,604 |
se_79667331 | stackoverflow | MACHINE_LEARNING | Why does my model's accuracy drop from ~95% on my device to ~25% on Edge Impulse? | Why does my model's accuracy drop from ~95% on my device to ~25% on Edge Impulse?
I'm experiencing a significant drop in accuracy when uploading my model, dataset, and labels to Edge Impulse. The model performs with ~95% accuracy locally but only achieves ~25% accuracy in Edge Impulse.
I've ensured the following:
... | https://stackoverflow.com/questions/79667331/why-does-my-models-accuracy-drop-from-95-on-my-device-to-25-on-edge-impulse | tensorflow, machine-learning | 1,750,065,101 |
se_76083492 | stackoverflow | MACHINE_LEARNING | Tensorflow does not detect GPU altough the GPU driver and Cuda are installed | Tensorflow does not detect GPU altough the GPU driver and Cuda are installed
I have an Nvidia GPU (Geforce RTX 3090) and the driver is displayed in Nvidia Control Panel. I also have installed the latest version of Cuda. However, when using the following code in Python with TensorFlow:
gpus = tf.config.list_physical_de... | https://stackoverflow.com/questions/76083492/tensorflow-does-not-detect-gpu-altough-the-gpu-driver-and-cuda-are-installed | python, tensorflow, gpu | 1,682,232,613 |
se_78871900 | stackoverflow | MACHINE_LEARNING | ValueError: Unknown layer: 'GetItem' | ValueError: Unknown layer: 'GetItem'
Here is the full error message:
ValueError: Unknown layer: 'GetItem'. Please ensure you are using a keras.utils.custom_object_scope and that this object is included in the scope. See https://www.tensorflow.org/guide/keras/save_and_serialize#registering_the_custom_object fo... | https://stackoverflow.com/questions/78871900/valueerror-unknown-layer-getitem | python, python-3.x, tensorflow, keras | 1,723,650,850 |
se_77029483 | stackoverflow | MACHINE_LEARNING | Why do I run out of memory when training with a large dataset, but have no problems with a small dataset? | Why do I run out of memory when training with a large dataset, but have no problems with a small dataset?
I'm trying to build a keypoint detection system using Keras. I've got a UNet like model, with a series of convolutions, batch normalization, and max pooling, followed by a symmetric series of up sampling, convolut... | https://stackoverflow.com/questions/77029483/why-do-i-run-out-of-memory-when-training-with-a-large-dataset-but-have-no-probl | python, tensorflow, machine-learning, keras | 1,693,678,213 |
se_53633838 | stackoverflow | MACHINE_LEARNING | Resolving differences between Keras and scikit-learn for simple fully-connected neural network | Resolving differences between Keras and scikit-learn for simple fully-connected neural network
I have built a fully-connected neural network in both scikit-learn (v 0.20.0) and Keras (v 2.2.4) with TensorFlow backend (v 1.12.0). There are 10 units in the single hidden layer. In both cases I choose the training and t... | https://stackoverflow.com/questions/53633838/resolving-differences-between-keras-and-scikit-learn-for-simple-fully-connected | python, tensorflow, scikit-learn, keras | 1,544,017,705 |
se_79662338 | stackoverflow | MACHINE_LEARNING | Tensorflow deployment, could not locate function 'mse' | Tensorflow deployment, could not locate function 'mse'
My Model
model = Sequential()
model.add(Bidirectional(LSTM(128, return_sequences=True), input_shape=(X.shape[1], X.shape[2])))
model.add(Dropout(0.2))
model.add(Bidirectional(LSTM(50)))
model.add(Dropout(0.2))
model.add(Dense(1)) # Output: 1 nilai (Close ... | https://stackoverflow.com/questions/79662338/tensorflow-deployment-could-not-locate-function-mse | python, tensorflow, deployment, model | 1,749,658,692 |
se_79378738 | stackoverflow | MACHINE_LEARNING | BERT model: model.fit throws "Invalid dtype: object" error | BERT model: model.fit throws "Invalid dtype: object" error
I been trying everything to make the following code work:
from tf_keras.src.layers.serialization import activation
import keras_nlp
# bert layers
text_input = tf.keras.layers.Input(shape=(), dtype=tf.string ,name="text")
preprocessor = keras_nlp.mod... | https://stackoverflow.com/questions/79378738/bert-model-model-fit-throws-invalid-dtype-object-error | python, tensorflow, keras | 1,737,567,647 |
se_78742116 | stackoverflow | MACHINE_LEARNING | tensorflow stuck in load_model | tensorflow stuck in load_model
I'm trying to load a model that I have trained in Google Colab, using Ubuntu 24.04 with conda 24.5.0, NVIDIA-SMI 555.58.02, Driver Version 556.12, CUDA 12.5 All my drivers are updated, but when I try to run the follwing code, it gets stucked loading the model. I have already tried to im... | https://stackoverflow.com/questions/78742116/tensorflow-stuck-in-load-model | python, tensorflow, keras | 1,720,815,870 |
se_69950509 | stackoverflow | MACHINE_LEARNING | TensorFlow install error, Windows LongPath support not enabled | TensorFlow install error, Windows LongPath support not enabled
I'm trying to install TensorFlow but I keep getting a longpath error , I have Python 3.9 installed and pip 21.3.1. Whenever I run pip install tensorflow I receive the following error:
ERROR: Could not install packages due to an OSError: [Errno 2] No such f... | https://stackoverflow.com/questions/69950509/tensorflow-install-error-windows-longpath-support-not-enabled | python, tensorflow, pip | 1,636,764,038 |
se_67611744 | stackoverflow | MACHINE_LEARNING | Calculate cosine similarity for elmo model | Calculate cosine similarity for elmo model
I am trying to calculate the cosine similarity of wordsim set using the Elmo model. This may not make sense since it is designed for sentence word embedding, but I want to see how the model performs in the situations like these. The Elmo I am using is from:
https://tfhub.dev/... | https://stackoverflow.com/questions/67611744/calculate-cosine-similarity-for-elmo-model | python, tensorflow, word-embedding, elmo | 1,621,463,548 |
se_78766873 | stackoverflow | MACHINE_LEARNING | Unable to import SentenceTransformer | Unable to import SentenceTransformer
I am using Colab, I am trying to import SentenceTransformer:
from sentence_transformers import SentenceTransformer
However, I got this error:
ttributeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/transformers/utils/impor... | https://stackoverflow.com/questions/78766873/unable-to-import-sentencetransformer | tensorflow, large-language-model, embedding, sentence-transformers | 1,721,341,482 |
se_63734942 | stackoverflow | MACHINE_LEARNING | ImportError: cannot import name 'tensorflow' from partially initialized module 'opt_einsum.backends' | ImportError: cannot import name 'tensorflow' from partially initialized module 'opt_einsum.backends'
import tensorflow as tf
when I run this code, I got an error. cannot import name 'tensorflow' from partially initialized module 'opt_einsum.backends'
I have no idea how I can solve this problem. | https://stackoverflow.com/questions/63734942/importerror-cannot-import-name-tensorflow-from-partially-initialized-module | python, tensorflow, importerror | 1,599,194,402 |
se_60056372 | stackoverflow | MACHINE_LEARNING | How to install tensorflow? | How to install tensorflow?
I am having some difficulties in installing TensorFlow on my computer.
My OS: Windows 8
My Python version: 3.7 (64-bit)
I used pip install Tensorflow
https://www.tensorflow.org/install/pip
Should I copy its commands to cmd? Or I should change some details of them accordingly?
For exam... | https://stackoverflow.com/questions/60056372/how-to-install-tensorflow | python, tensorflow | 1,580,815,573 |
se_79655975 | stackoverflow | MACHINE_LEARNING | Fourier Neural Operator in tensorflow nearly good | Fourier Neural Operator in tensorflow nearly good
I try to implement in tensorflow a Fourier Neural Operator from this paper in 2D. As simple example, i have a single layer that learns to perform a gaussian blur.
However, there are littles errors especialy on horizontal lines (right image). I dont know why.
Many thank... | https://stackoverflow.com/questions/79655975/fourier-neural-operator-in-tensorflow-nearly-good | python, tensorflow, deep-learning, fft | 1,749,215,060 |
se_79652218 | stackoverflow | MACHINE_LEARNING | Tensorflow - validation metric does not show up, it gets the same name as the train metric | Tensorflow - validation metric does not show up, it gets the same name as the train metric
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 have debugged therefore tensor... | https://stackoverflow.com/questions/79652218/tensorflow-validation-metric-does-not-show-up-it-gets-the-same-name-as-the-tr | python, tensorflow, keras | 1,749,018,756 |
se_79652372 | stackoverflow | MACHINE_LEARNING | I'm training a image captioning model and getting Nan in my loss | I'm training a image captioning model and getting Nan in my loss
I'm training a image caption model using TensorFlow. I'm using Flickr 8K dataset and I have used ResNet50 to get the encoding of all my images shaped as (m,49,2048) and stored them for training. I have used GloVe 6B 300d vectors for my vocab and embe... | https://stackoverflow.com/questions/79652372/im-training-a-image-captioning-model-and-getting-nan-in-my-loss | image, tensorflow, deep-learning, nan, loss | 1,749,025,145 |
se_77546793 | stackoverflow | MACHINE_LEARNING | ERROR: No matching distribution found for tensorflow==2.5 | ERROR: No matching distribution found for tensorflow==2.5
I am trying to run the tutorial in google colab
!pip install tflite-model-maker tensorflow==2.5
Getting the error for cell-2:
Collecting tflite-model-maker
Downloading tflite_model_maker-0.4.2-py3-none-any.whl (577 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━... | https://stackoverflow.com/questions/77546793/error-no-matching-distribution-found-for-tensorflow-2-5 | python, tensorflow, google-colaboratory | 1,700,891,384 |
se_70296539 | stackoverflow | MACHINE_LEARNING | Mean squared error computed by TensorFlow | Mean squared error computed by TensorFlow
I am trying to figure out how the mean squared error (MSE) is calculated by tensorflow and was reading the post at https://www.tensorflow.org/api_docs/python/tf/keras/metrics/mean_squared_error.
First of all, MSE is defined as (see https://en.wikipedia.org/wiki/Mean_squared_er... | https://stackoverflow.com/questions/70296539/mean-squared-error-computed-by-tensorflow | python, tensorflow, keras, mean-square-error | 1,639,082,967 |
se_79644926 | stackoverflow | MACHINE_LEARNING | Python/TensorFlow: Persistent RAM increase in a long-running loop despite clear_session and gc.collect | Python/TensorFlow: Persistent RAM increase in a long-running loop despite clear_session and gc.collect
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 steadily increases ove... | https://stackoverflow.com/questions/79644926/python-tensorflow-persistent-ram-increase-in-a-long-running-loop-despite-clear | python, tensorflow, keras, memory-leaks, garbage-collection | 1,748,582,356 |
se_79650499 | stackoverflow | MACHINE_LEARNING | Model ouput of Android(Kotlin) tflite model not matching Python output for same input | Model ouput of Android(Kotlin) tflite model not matching Python output for same input
I have already asked this question over on Google Ai for Devs, but have not received an answer, so I will try my luck here. I am currently working on testing inference speeds of different object detection models and my code works for... | https://stackoverflow.com/questions/79650499/model-ouput-of-androidkotlin-tflite-model-not-matching-python-output-for-same | python, android, kotlin, tensorflow, tensorflow-lite | 1,748,911,835 |
se_77598186 | stackoverflow | MACHINE_LEARNING | How to resolve 'ImportError: `save_weights` requires h5py when saving in hdf5' | How to resolve 'ImportError: `save_weights` requires h5py when saving in hdf5'
I have this code for training a facial emotion recognition model using tensorflow.
after i trained it and took hours the h5 file didnt saved so i added a time range of 10seconds just to test saving of h5 file.
The problem is that ea... | https://stackoverflow.com/questions/77598186/how-to-resolve-importerror-save-weights-requires-h5py-when-saving-in-hdf5 | python, tensorflow, h5py | 1,701,679,645 |
se_76029717 | stackoverflow | MACHINE_LEARNING | Having trouble correctly importing tensorflow Tokenizer and tensorflow padded_sequences | Having trouble correctly importing tensorflow Tokenizer and tensorflow padded_sequences
I have a neural network that takes data from a txt file and uses nlp to learn how to speak like a human. But whenever I load Tokenizer and padded_sequences, (which are both needed)
they do not correctly import.
I believe that there... | https://stackoverflow.com/questions/76029717/having-trouble-correctly-importing-tensorflow-tokenizer-and-tensorflow-padded-se | python, tensorflow, neural-network, nlp | 1,681,670,862 |
se_63146831 | stackoverflow | MACHINE_LEARNING | What is the analytic interpretation for a TensorFlow custom gradient? | What is the analytic interpretation for a TensorFlow custom gradient?
In the official tf.custom_gradient documentation, it shows how to define custom gradients for log(1 + exp(x)):
@tf.custom_gradient
def log1pexp(x):
e = tf.exp(x)
def grad(dy):
return dy * (1 - 1 / (1 + e))
return tf.math.log(1 + e), grad
... | https://stackoverflow.com/questions/63146831/what-is-the-analytic-interpretation-for-a-tensorflow-custom-gradient | python, tensorflow, tensorflow2.0, gradient-descent | 1,596,000,375 |
se_42521400 | stackoverflow | MACHINE_LEARNING | Calculating cross entropy in TensorFlow | Calculating cross entropy in TensorFlow
I am having a hard time with calculating cross entropy in TensorFlow. In particular, I am using the function:
tf.nn.softmax_cross_entropy_with_logits()
Using what is seemingly simple code, I can only get it to return a zero:
import tensorflow as tf
import numpy as np
sess = tf... | https://stackoverflow.com/questions/42521400/calculating-cross-entropy-in-tensorflow | python, machine-learning, tensorflow, cross-entropy | 1,488,329,902 |
se_79395477 | stackoverflow | MACHINE_LEARNING | How to save a Dataset in multiple shards using `tf.data.Dataset.save` | How to save a Dataset in multiple shards using `tf.data.Dataset.save`
How can I save a tf.data.Dataset in multiple shards using tf.data.Dataset.save()? I am reading in my dataset from CSV using tf.data.experimental.make_csv_dataset.
The TF docs here are not very helpful. There is a shard_func argument, but the exampl... | https://stackoverflow.com/questions/79395477/how-to-save-a-dataset-in-multiple-shards-using-tf-data-dataset-save | python, tensorflow, machine-learning | 1,738,109,334 |
se_79620554 | stackoverflow | MACHINE_LEARNING | Despite tensorflow.compat.v1, still receiving deprecation and versioning errors | Despite tensorflow.compat.v1, still receiving deprecation and versioning errors
I'm trying to run this repo and to run it, I'm introducing
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
to fix versioning issues. While my project partners are able to do this on their machines, I'm running into an issue whe... | https://stackoverflow.com/questions/79620554/despite-tensorflow-compat-v1-still-receiving-deprecation-and-versioning-errors | python, tensorflow | 1,747,181,003 |
se_78857350 | stackoverflow | MACHINE_LEARNING | Converted Model Using TensorFlow.JS Converter Not Working | Converted Model Using TensorFlow.JS Converter Not Working
I was following the TFJS WebML YT Course from Jason Mayes and following along to the TFJS Converter video, here's my notebook:
Google Colab Notebook
Basically it is an exact replica from the video and with a few extra warnings here and there, the model files we... | https://stackoverflow.com/questions/78857350/converted-model-using-tensorflow-js-converter-not-working | javascript, python, tensorflow, tensorflow.js, mobilenet | 1,723,340,145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.