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_58188704 | stackoverflow | MACHINE_LEARNING | Unable to import Keras(from TensorFlow 2.0) in PyCharm 2019.2 | Unable to import Keras(from TensorFlow 2.0) in PyCharm 2019.2
I have just installed the stable version of TensorFlow 2.0 (released on October 1st 2019) in PyCharm.
The problem is that the keras package is unavailable.
The actual error is :
"cannot import name 'keras' from tensorflow"
I have installed via pi... | https://stackoverflow.com/questions/58188704/unable-to-import-kerasfrom-tensorflow-2-0-in-pycharm-2019-2 | tensorflow, keras, pycharm, tensorflow2.0, tf.keras | 1,569,946,147 |
se_79437180 | stackoverflow | MACHINE_LEARNING | Tensorflow perfomance issue | Tensorflow perfomance issue
I'm trying to do a very primitive reinforced learning model on tensorflow. Although it's relatively small, a single iteration takes ~6-7 seconds.
def build_model():
model = keras.Sequential([
layers.Input(shape=(400,)),
layers.Dense(128, activation="relu"),
layer... | https://stackoverflow.com/questions/79437180/tensorflow-perfomance-issue | python, python-3.x, tensorflow, machine-learning | 1,739,466,429 |
se_79384093 | stackoverflow | MACHINE_LEARNING | Error: 'Could not find variable batch_normalization_7/beta' when deploying custom model with TF-Serving | Error: 'Could not find variable batch_normalization_7/beta' when deploying custom model with TF-Serving
I have trained my model using transfer learning and model sequential.
inceptionv3_model = InceptionV3(weights="imagenet", include_top=False, input_shape=(224, 224, 3))
inceptionv3_model.trainable = False
mo... | https://stackoverflow.com/questions/79384093/error-could-not-find-variable-batch-normalization-7-beta-when-deploying-custo | python, docker, tensorflow | 1,737,716,390 |
se_58848100 | stackoverflow | MACHINE_LEARNING | Is there a similar function in tensorflow like load_state_dict() in Pytorch? | Is there a similar function in tensorflow like load_state_dict() in Pytorch?
Like it has been described, I am wondering is there a similar function in tensorflow for load_state_dict() like the one does in Pytorch. To demonstrate a scenario, please refer to the code following:
# Suppose we have two correctly initiali... | https://stackoverflow.com/questions/58848100/is-there-a-similar-function-in-tensorflow-like-load-state-dict-in-pytorch | tensorflow, neural-network, deep-learning, pytorch | 1,573,695,191 |
se_79431252 | stackoverflow | MACHINE_LEARNING | gradient tape for custom loss function | gradient tape for custom loss function
I'm currently working with an autoencoder in hopes to test its accuracy vs pca. My tutor asked me to add a custom loss function that involves the derivatives of the decoder output with respect to the latent space variables.
So far I have this code but I can't get it to work. I r... | https://stackoverflow.com/questions/79431252/gradient-tape-for-custom-loss-function | tensorflow, keras, tf.keras, autoencoder, gradienttape | 1,739,305,964 |
se_70408145 | stackoverflow | MACHINE_LEARNING | Select a column without "losing" a dimension | Select a column without "losing" a dimension
Suppose I execute the following code
W = tf.random.uniform(shape = (100,1), minval = 0, maxval = 1)
Z = tf.random.uniform(shape = (100,1), minval = 0, maxval = 1)
X = tf.concat([W,Z],1)
The shape of X[:,1] would be [100,]. That is, X[:,1].shape would yield [100,]... | https://stackoverflow.com/questions/70408145/select-a-column-without-losing-a-dimension | python, tensorflow | 1,639,873,306 |
se_55178230 | stackoverflow | MACHINE_LEARNING | What is the difference between keras and tf.keras? | What is the difference between keras and tf.keras?
I'm learning TensorFlow and Keras. I'd like to try https://www.amazon.com/Deep-Learning-Python-Francois-Chollet/dp/1617294438/, and it seems to be written in Keras.
Would it be fairly straightforward to convert code to tf.keras?
I'm not more interested in the portab... | https://stackoverflow.com/questions/55178230/what-is-the-difference-between-keras-and-tf-keras | tensorflow, keras, difference, tf.keras | 1,552,637,698 |
se_66996570 | stackoverflow | MACHINE_LEARNING | How to remove false detection (False Positives) in Faster RCNN | How to remove false detection (False Positives) in Faster RCNN
I am using Faster RCNN with Inception V2 on custom dataset. My model is working fine with good detection accuracy. However, I am facing false positive problem when I pass an image to the model I get correct prediction but I am also getting some wrong bound... | https://stackoverflow.com/questions/66996570/how-to-remove-false-detection-false-positives-in-faster-rcnn | performance, tensorflow, object-detection, faster-rcnn | 1,617,848,957 |
se_70492987 | stackoverflow | MACHINE_LEARNING | No module name 'tensorflow' | No module name 'tensorflow'
The requirements for the code to run is
Python 2.7
TensorFlow 1.n
SciPy & NumPy
I have python 2.7.8 by checking python --version. Installing them on python website also lead to a message saying there is no software to install so I assumed that I already have python 2.7x
For tensor... | https://stackoverflow.com/questions/70492987/no-module-name-tensorflow | python, numpy, tensorflow, visual-studio-code, module | 1,640,592,218 |
se_68961643 | stackoverflow | MACHINE_LEARNING | What is https://storage.googleapis.com and how do I use and explore it? | What is https://storage.googleapis.com and how do I use and explore it?
I've been seeing such snippets in a lot of notebooks of tensorflow tutorials
!wget --no-check-certificate \
https://storage.googleapis.com/mledu-datasets/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5 \
-O /tmp/inception_v3_weigh... | https://stackoverflow.com/questions/68961643/what-is-https-storage-googleapis-com-and-how-do-i-use-and-explore-it | tensorflow | 1,630,128,930 |
se_78466700 | stackoverflow | MACHINE_LEARNING | An InputLayer should be passed either a `batchInputShape` or an `inputShape` | An InputLayer should be passed either a `batchInputShape` or an `inputShape`
I saved a CNN model using tfjs. But when I tried to load the model in js I got the following error
tfjs Uncaught (in promise) Error: An InputLayer should be passed either a `batchInputShape` or an `inputShape`.
Here is the architecture of my... | https://stackoverflow.com/questions/78466700/an-inputlayer-should-be-passed-either-a-batchinputshape-or-an-inputshape | tensorflow, conv-neural-network, tensorflow.js | 1,715,488,111 |
se_79426632 | stackoverflow | MACHINE_LEARNING | Tensorflow - Encode Target Labels within Pipeline | Tensorflow - Encode Target Labels within Pipeline
I know this is not efficient/optimal for this data; this is just for study and me trying to understand it.
I have a DataFrame with 4 numerical features and a class label with 3 unique string values
iris_df.
I would like to be able to create a DataPipeline that would ac... | https://stackoverflow.com/questions/79426632/tensorflow-encode-target-labels-within-pipeline | python, tensorflow, keras, neural-network, pipeline | 1,739,180,199 |
se_79426206 | stackoverflow | MACHINE_LEARNING | Understanding YOLOv11 Tensor Ouput Shape for Post-Processing | Understanding YOLOv11 Tensor Ouput Shape for Post-Processing
I tried export YOLOv11 model to tensorflow, it said:
'yolo11n.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 84, 8400) (5.4 MB)
Now I have this model summary in Keras 3:
Model: "functional_1"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━... | https://stackoverflow.com/questions/79426206/understanding-yolov11-tensor-ouput-shape-for-post-processing | python, numpy, tensorflow, yolo, ultralytics | 1,739,167,920 |
se_50996574 | stackoverflow | MACHINE_LEARNING | error when trying to use keras.utils.plot_model | error when trying to use keras.utils.plot_model
I am trying to make a plot/graph of deep learning model in Python using Keras package but unfortunately it keeps giving me an error which is not very informative.
I run python on Linux with Python 3.5.2, Anaconda 4.2.0, Keras 2.1.6 and I use tensorflow-gpu 1.7.0 Backend... | https://stackoverflow.com/questions/50996574/error-when-trying-to-use-keras-utils-plot-model | python, tensorflow, keras | 1,529,709,227 |
se_78187204 | stackoverflow | MACHINE_LEARNING | Trying to export Teachable Machine Model But returning error | Trying to export Teachable Machine Model But returning error
I have just exported a teachable machine model in the h5 file format, and i set it up locally in my development environment but i keep getting this error
TypeError: Error when deserializing class 'DepthwiseConv2D' using config={'name': 'expanded_conv_depthwi... | https://stackoverflow.com/questions/78187204/trying-to-export-teachable-machine-model-but-returning-error | python, tensorflow | 1,710,856,654 |
se_79428265 | stackoverflow | MACHINE_LEARNING | Failed to execute a prediction with the Tensorflow C++ API | Failed to execute a prediction with the Tensorflow C++ API
I have created and trained a model to recognize some cartoon's character.
I'm using TensorFlow 2.18, and the model trained with TF Python API is accurate enough.
The accuracy is pretty excellent.
After the training, the model is saved with tensorflow.saved_mod... | https://stackoverflow.com/questions/79428265/failed-to-execute-a-prediction-with-the-tensorflow-c-api | c++, tensorflow, machine-learning | 1,739,220,246 |
se_52209851 | stackoverflow | MACHINE_LEARNING | Expected validation accuracy for Keras Mobile Net V1 for CIFAR-10 (training from scratch) | Expected validation accuracy for Keras Mobile Net V1 for CIFAR-10 (training from scratch)
Has anybody trained Mobile Net V1 from scratch using CIFAR-10? What was the maximum accuracy you got? I am getting stuck at 70% after 110 epochs. Here is how I am creating the model. However, my training accuracy is above 99%.
#... | https://stackoverflow.com/questions/52209851/expected-validation-accuracy-for-keras-mobile-net-v1-for-cifar-10-training-from | tensorflow, keras, deep-learning | 1,536,257,001 |
se_79425592 | stackoverflow | MACHINE_LEARNING | Unable to install tensorflow-federated on M2 Macbook | Unable to install tensorflow-federated on M2 Macbook
I am currently facing a really frustrating problem with installing tensorflow federated. I am on M2 Macbook Air, using virtual env, no conda.
I was following this tutorial, and did the following:
Created a new folder
Set the local Python versoion to: pyenv local 3.... | https://stackoverflow.com/questions/79425592/unable-to-install-tensorflow-federated-on-m2-macbook | python, tensorflow, python-venv, tensorflow-federated | 1,739,129,962 |
se_78650554 | stackoverflow | MACHINE_LEARNING | Resolving TensorFlow AttributeError: Missing 'register_load_context_function' | Resolving TensorFlow AttributeError: Missing 'register_load_context_function'
AttributeError: module 'tensorflow._api.v2.compat.v2.internal' has
no attribute 'register_load_context_function'. Did you mean:
'register_call_context_function'?
I am done with update tensorflow and other library but its showing err... | https://stackoverflow.com/questions/78650554/resolving-tensorflow-attributeerror-missing-register-load-context-function | python, tensorflow, attributeerror | 1,718,948,082 |
se_79421842 | stackoverflow | MACHINE_LEARNING | How to Select/Isolate GPUs when Using ROCm in Python | How to Select/Isolate GPUs when Using ROCm in Python
Is their an equivalent for os.environ["CUDA_VISIBLE_DEVICES"]="0" in the os module for isolating GPUs when using AMD ROCm? | https://stackoverflow.com/questions/79421842/how-to-select-isolate-gpus-when-using-rocm-in-python | python, tensorflow, pytorch, amd-gpu, amd-rocm | 1,738,953,088 |
se_76033095 | stackoverflow | MACHINE_LEARNING | failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error | failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error
When I run the following code:
import tensorflow as tf
if tf.config.list_physical_devices('GPU'):
print('GPU is available and configured for TensorFlow')
else:
print('GPU is not available or not properly configured for TensorFlow')
I get the following e... | https://stackoverflow.com/questions/76033095/failed-call-to-cuinit-cuda-error-unknown-unknown-error | tensorflow, gpu | 1,681,719,981 |
se_79398319 | stackoverflow | MACHINE_LEARNING | Is there another method to install tensorflow 2.18.0 with python 3.13.1? | Is there another method to install tensorflow 2.18.0 with python 3.13.1?
I want to install tensorflow in my machine but I have a problem during the installation. I tried all method but no result
C:\Users\Ultra Tech>pip --default-timeout=1000 install tensorflow==2.5.0
ERROR: Could not find a version that satisfies the ... | https://stackoverflow.com/questions/79398319/is-there-another-method-to-install-tensorflow-2-18-0-with-python-3-13-1 | python, tensorflow, deep-learning, pip | 1,738,188,659 |
se_79414361 | stackoverflow | MACHINE_LEARNING | Use GPU for deeplearning with TensorFlow | Use GPU for deeplearning with TensorFlow
I would like to be able to use my GPU for deeplearning with tensorflow, my graphics card is an NVIDIA GeForce GTX 1050 Ti, I am on Windows 11, the version of tensorflow that I am using is 2.18.0, the version of cuda that I have downloaded is 12.4.0, the version of cudnn that I ... | https://stackoverflow.com/questions/79414361/use-gpu-for-deeplearning-with-tensorflow | python, tensorflow, gpu, nvidia | 1,738,749,893 |
se_79411501 | stackoverflow | MACHINE_LEARNING | How to pass Input to a tensorflow backbone model without getting AttributeError: 'tuple' object has no attribute 'as_list' | How to pass Input to a tensorflow backbone model without getting AttributeError: 'tuple' object has no attribute 'as_list'
I am trying to use ResNet3D from tensorflow-models library but I am getting this weird error when trying to run the block
!pip install tf-models-official==2.17.0
Tensorflow versio... | https://stackoverflow.com/questions/79411501/how-to-pass-input-to-a-tensorflow-backbone-model-without-getting-attributeerror | python, tensorflow, machine-learning, deep-learning, tf.keras | 1,738,668,161 |
se_59851961 | stackoverflow | MACHINE_LEARNING | How to calculate confidence score of a Neural Network prediction | How to calculate confidence score of a Neural Network prediction
I am using a deep neural network model (implemented in keras)to make predictions. Something like this:
def make_model():
model = Sequential()
model.add(Conv2D(20,(5,5), activation = "relu"))
model.add(MaxPooling2D(pool_size=(2,2)))
model.a... | https://stackoverflow.com/questions/59851961/how-to-calculate-confidence-score-of-a-neural-network-prediction | tensorflow, machine-learning, keras, confidence-interval, uncertainty | 1,579,661,552 |
se_78540179 | stackoverflow | MACHINE_LEARNING | Pretrain model developing in tensorflow for image classification | Pretrain model developing in tensorflow for image classification
I have a issue regarding on how to modify a pretrained model to classify 3 classes instead of 1000. These are the 2 methods i came up with so far.. im not sure which one is the best.
NASNetMobile_model = tf.keras.applications.NASNetMobile (
... | https://stackoverflow.com/questions/78540179/pretrain-model-developing-in-tensorflow-for-image-classification | python, tensorflow, machine-learning, tf.keras, pre-trained-model | 1,716,826,932 |
se_58390209 | stackoverflow | MACHINE_LEARNING | ResNet50 Model is not learning with transfer learning in keras | ResNet50 Model is not learning with transfer learning in keras
I am trying to perform transfer learning on ResNet50 model pretrained on Imagenet weights for PASCAL VOC 2012 dataset. As it is a multi label dataset, I am using sigmoid activation function in the final layer and binary_crossentropy loss. The metrics are p... | https://stackoverflow.com/questions/58390209/resnet50-model-is-not-learning-with-transfer-learning-in-keras | tensorflow, machine-learning, keras, conv-neural-network, resnet | 1,571,127,612 |
se_76742434 | stackoverflow | MACHINE_LEARNING | Python - Unable to install rasa on Mac M1, getting pip error | Python - Unable to install rasa on Mac M1, getting pip error
I'm trying to install rasa on my M1 MacBook Air using this guide. However, when I enter this:
conda env create -v --name rasatest -f env.yml
I am presented with this error:
raise CondaEnvException("Pip failed")
conda.exceptions.CondaEnvException: Pip failed
... | https://stackoverflow.com/questions/76742434/python-unable-to-install-rasa-on-mac-m1-getting-pip-error | python, tensorflow, rasa, rasa-nlu, rasa-x | 1,690,003,738 |
se_61046588 | stackoverflow | MACHINE_LEARNING | Keras, memoryerror - data = data.astype("float") / 255.0. Unable to allocate 309. MiB for an array with shape (13165, 32, 32, 3) | Keras, memoryerror - data = data.astype("float") / 255.0. Unable to allocate 309. MiB for an array with shape (13165, 32, 32, 3)
I am currently working on the Smiles dataset and then applying Deep learning to detect the smile as positive or negative. The machine I am using is Raspberry Pi 3, and the version ... | https://stackoverflow.com/questions/61046588/keras-memoryerror-data-data-astypefloat-255-0-unable-to-allocate-309 | python, tensorflow, machine-learning, keras, deep-learning | 1,586,107,526 |
se_79410073 | stackoverflow | MACHINE_LEARNING | AttributeError: 'super' object has no attribute 'sklearn_tags' when using GridSearchCV with KerasClassifier | AttributeError: 'super' object has no attribute 'sklearn_tags' when using GridSearchCV with KerasClassifier
I am working on a binary classification problem using a neural network with TensorFlow/Keras and scikit-learn's GridSearchCV for hyperparameter tuning. However, I am encountering an AttributeErro... | https://stackoverflow.com/questions/79410073/attributeerror-super-object-has-no-attribute-sklearn-tags-when-using-gridse | python, tensorflow, keras, hyperparameters, gridsearchcv | 1,738,618,568 |
se_79228937 | stackoverflow | MACHINE_LEARNING | Unrecognized keyword arguments passed to DepthwiseConv2D: {'groups': 1} error when loading the .h5 model in tensorflow colab | Unrecognized keyword arguments passed to DepthwiseConv2D: {'groups': 1} error when loading the .h5 model in tensorflow colab
I'm trying to load this face anit-spoofing model. It is a MobileNetV2 model. I want to convert it to coreML format. I have uploaded the .h5 model file into the colab. But when I try to l... | https://stackoverflow.com/questions/79228937/unrecognized-keyword-arguments-passed-to-depthwiseconv2d-groups-1-error-wh | python, tensorflow, keras, coremltools | 1,732,681,821 |
se_79415301 | stackoverflow | MACHINE_LEARNING | Using a symbolic `tf.Tensor` as a Python `bool` is not allowed | Using a symbolic `tf.Tensor` as a Python `bool` is not allowed
when I add a masking layer in my model, it gives this error. works fine without the masking tho. If anyone can solve this, id be grateful ! been scratching my head for 3 days now.
TensorFlow 2.17
def build_lstm(examples):
print("Building Model")
X_... | https://stackoverflow.com/questions/79415301/using-a-symbolic-tf-tensor-as-a-python-bool-is-not-allowed | python, tensorflow, keras, lstm, mask | 1,738,769,295 |
se_79414036 | stackoverflow | MACHINE_LEARNING | How to have reproducibility with Keras, Tensorflow? | How to have reproducibility with Keras, Tensorflow?
I am not getting the same accuracy and loss each time I run the following code. I followed the instructions from previous posts, but I couldn't resolve it. What could be the problem?
import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
os.environ["TF_DETERMINISTIC_OPS... | https://stackoverflow.com/questions/79414036/how-to-have-reproducibility-with-keras-tensorflow | python, tensorflow, machine-learning, keras | 1,738,742,942 |
se_79166453 | stackoverflow | MACHINE_LEARNING | VAalue_Error: as_list() is not defined on an unknown TensorShape when using dataset generator | VAalue_Error: as_list() is not defined on an unknown TensorShape when using dataset generator
There are a number of previous answers to this error but none relate to my issue.
I am creating a tensorflow dataset using a generator and for the examples sake am trying fit a very simple API model.
The dataset looks like th... | https://stackoverflow.com/questions/79166453/vaalue-error-as-list-is-not-defined-on-an-unknown-tensorshape-when-using-data | tensorflow, neural-network, tensorflow-datasets | 1,730,982,924 |
se_44181511 | stackoverflow | MACHINE_LEARNING | Hyperparameter tune for Tensorflow | Hyperparameter tune for Tensorflow
I am searching for a hyperparameter tune package for code written directly in Tensorflow (not Keras or Tflearn). Could you make some suggestion? | https://stackoverflow.com/questions/44181511/hyperparameter-tune-for-tensorflow | optimization, tensorflow, machine-learning, bayesian, hyperparameters | 1,495,718,033 |
se_79056758 | stackoverflow | MACHINE_LEARNING | Unresolved reference: tensorflow | Unresolved reference: tensorflow
I am working with artificial intelligence models and Flutter, and in this context, I need to use some Kotlin code in my project. However, when I import the TensorFlow packages into the file, I get the error 'Unresolved reference: tensorflow' and cannot use the package.
There is my grad... | https://stackoverflow.com/questions/79056758/unresolved-reference-tensorflow | flutter, kotlin, tensorflow, flutter-dependencies, tflite | 1,728,121,351 |
se_68981874 | stackoverflow | MACHINE_LEARNING | What is sharding in machine learning and how to do sharding in Tensorflow? | What is sharding in machine learning and how to do sharding in Tensorflow?
What is sharding in the context of machine learning specifically ( a more generic antic question is asked here ) and how is it implemented in Tensorflow ?
What is referred to as sharding, why do we need sharding altogether, when speaking about... | https://stackoverflow.com/questions/68981874/what-is-sharding-in-machine-learning-and-how-to-do-sharding-in-tensorflow | python, tensorflow, machine-learning, input, sharding | 1,630,316,108 |
se_79401244 | stackoverflow | MACHINE_LEARNING | tensorflow repeated calls to train_on_batch | tensorflow repeated calls to train_on_batch
I have a tensorflow model that I am training. The y data is partially generated by using predictions from the neural network, so I cannot simply use model.fit(x,y,...)
This means I need to take some sample of a batch of x data, make a prediction, do something with that pred... | https://stackoverflow.com/questions/79401244/tensorflow-repeated-calls-to-train-on-batch | python, tensorflow, keras | 1,738,271,410 |
se_62351295 | stackoverflow | MACHINE_LEARNING | How to gradually train a model on transformers library? | How to gradually train a model on transformers library?
I have seen this tutorial on how to train a BERT model from scratch on Hugging Face Transformers library.
I'm trying to train a GPT-2 model on 1.5 GB data on Google Colab. I load up all the data using this code:
dataset = LineByLineTextDataset(
tokenizer=t... | https://stackoverflow.com/questions/62351295/how-to-gradually-train-a-model-on-transformers-library | python, tensorflow, nlp, pytorch, huggingface-transformers | 1,591,990,655 |
se_50794177 | stackoverflow | MACHINE_LEARNING | Is there a logit function in tensorflow? | Is there a logit function in tensorflow?
Is there a logit function in tensorflow, i.e. the inverse of sigmoid function? I have searched google but have not found any. | https://stackoverflow.com/questions/50794177/is-there-a-logit-function-in-tensorflow | tensorflow, machine-learning, neural-network, inverse, activation-function | 1,528,708,476 |
se_79409678 | stackoverflow | MACHINE_LEARNING | TensorFlow Unable to Load Adam Optimizer in Google Colab | TensorFlow Unable to Load Adam Optimizer in Google Colab
I am trying to use Adam organizer in Google Colab. I have the following code:
import tensorflow as tf
import numpy as np
from transformers import BertTokenizer, TFBertForSequenceClassification
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.lo... | https://stackoverflow.com/questions/79409678/tensorflow-unable-to-load-adam-optimizer-in-google-colab | tensorflow, machine-learning, google-colaboratory | 1,738,606,966 |
se_49476043 | stackoverflow | MACHINE_LEARNING | Using Keras' tokenizer with premade indexed dictionary | Using Keras' tokenizer with premade indexed dictionary
I am working on an NLP problem.
I have downloaded premade embedding weights to use for an embedding layer. Before the embedding layer I need to tokenize my dataset which is currently in the form of strings of sentences. I want to tokenize it using the same i... | https://stackoverflow.com/questions/49476043/using-keras-tokenizer-with-premade-indexed-dictionary | tensorflow, keras | 1,521,982,258 |
se_44119207 | stackoverflow | MACHINE_LEARNING | Is there any way to get variable importance with Keras? | Is there any way to get variable importance with Keras?
I am looking for a proper or best way to get variable importance in a Neural Network created with Keras. The way I currently do it is I just take the weights (not the biases) of the variables in the first layer with the assumption that more important variables wi... | https://stackoverflow.com/questions/44119207/is-there-any-way-to-get-variable-importance-with-keras | tensorflow, deep-learning, keras, keras-layer, keras-2 | 1,495,475,666 |
se_79403749 | stackoverflow | MACHINE_LEARNING | TensorFlow 2.14.1 Not Detecting GPU on Ubuntu 24.04.1 LTS Despite CUDA Drivers Being Installed | TensorFlow 2.14.1 Not Detecting GPU on Ubuntu 24.04.1 LTS Despite CUDA Drivers Being Installed
I'm using TensorFlow 2.14.1 on Ubuntu 24.04.1 LTS. When I open a Python terminal and import TensorFlow (import tensorflow as tf), I encounter the following warnings:
I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cu... | https://stackoverflow.com/questions/79403749/tensorflow-2-14-1-not-detecting-gpu-on-ubuntu-24-04-1-lts-despite-cuda-drivers-b | tensorflow, ubuntu, machine-learning, gpu | 1,738,349,321 |
se_69782818 | stackoverflow | MACHINE_LEARNING | Turn a tf.data.Dataset to a jax.numpy iterator | Turn a tf.data.Dataset to a jax.numpy iterator
I am interested about training a neural network using JAX. I had a look on tf.data.Dataset, but it provides exclusively tf tensors. I looked for a way to change the dataset into JAX numpy array and I found a lot of implementations that use Dataset.as_numpy_generator() to ... | https://stackoverflow.com/questions/69782818/turn-a-tf-data-dataset-to-a-jax-numpy-iterator | python, tensorflow, numpy-ndarray, jax | 1,635,635,515 |
se_78215203 | stackoverflow | MACHINE_LEARNING | Image channel error while training CNN model | Image channel error while training CNN model
I get the following error when trying to train a CNN model:
InvalidArgumentError: Graph execution error:
Detected at node decode_image/DecodeImage defined at (most recent call last):
<stack traces unavailable>
Number of channels inherent in the image must be 1, 3 or 4, was... | https://stackoverflow.com/questions/78215203/image-channel-error-while-training-cnn-model | python, tensorflow, keras, deep-learning, conv-neural-network | 1,711,296,448 |
se_79404980 | stackoverflow | MACHINE_LEARNING | From keras 2 to keras 3 conversion of notebook | From keras 2 to keras 3 conversion of notebook
as the title suggests, I'm trying to convert a notebook in keras 3, but idk why it's not working properly.
This is the original notebook (tell me if it's better to put here the code), I'm trying to do the same task but with car fronts; at the end you can find my code.
I m... | https://stackoverflow.com/questions/79404980/from-keras-2-to-keras-3-conversion-of-notebook | tensorflow, keras, deep-learning, kaggle, siamese-network | 1,738,413,171 |
se_77199292 | stackoverflow | MACHINE_LEARNING | Requested the deserialization of a Lambda layer with a Python `lambda` inside it. you can pass `safe_mode=False` to the loading function | Requested the deserialization of a Lambda layer with a Python `lambda` inside it. you can pass `safe_mode=False` to the loading function
This is a Flask project and keras model, I'm getting the following error when running
"C:\Users\winne\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\layers\core\... | https://stackoverflow.com/questions/77199292/requested-the-deserialization-of-a-lambda-layer-with-a-python-lambda-inside-it | python, tensorflow, keras | 1,695,958,186 |
se_79401755 | stackoverflow | MACHINE_LEARNING | Training a Keras model to identify leap years | Training a Keras model to identify leap years
I'm trying to teach my learning model how to identify leap years.
My Python code can be seen below:
import tensorflow as tf
import numpy as np
import calendar
# ------------------- UTILITY FUNCTIONS -------------------
def is_leap(year):
"""Checks if a year is a leap ... | https://stackoverflow.com/questions/79401755/training-a-keras-model-to-identify-leap-years | python, numpy, tensorflow, machine-learning, keras | 1,738,296,899 |
se_78530683 | stackoverflow | MACHINE_LEARNING | "Created TensorFlow Lite XNNPACK delegate for CPU" message randomly appears when using selenium | "Created TensorFlow Lite XNNPACK delegate for CPU" message randomly appears when using selenium
I'm new to Selenium, and I was making a program that scrapes jobs from LinkedIn. However, while running the code, the message "Created TensorFlow Lite XNNPACK delegate for CPU" would randomly appear in the console... | https://stackoverflow.com/questions/78530683/created-tensorflow-lite-xnnpack-delegate-for-cpu-message-randomly-appears-when | tensorflow, selenium-webdriver | 1,716,584,662 |
se_79399217 | stackoverflow | MACHINE_LEARNING | Can batch normalization be considered a linear transformation? | Can batch normalization be considered a linear transformation?
A deep neural network f consists of one fully connected network and one batch normalization layer. (e.g., f = FCN + BN)
Given a dataset with inputs x and y, can the following property hold?
f(x+y) = f(x) + f(y)
I think the fully connected network natural... | https://stackoverflow.com/questions/79399217/can-batch-normalization-be-considered-a-linear-transformation | tensorflow, deep-learning, pytorch, normalization | 1,738,225,616 |
se_79400259 | stackoverflow | MACHINE_LEARNING | tf.function decorator on custom model call Error | tf.function decorator on custom model call Error
I am using tensorflow to fit some version of a financial model. I have subclassed the keras.Model class to write some custom code. Everything seems to work well when I run the model in eager execution. To speed things up I wanted to use the functionality provided by the... | https://stackoverflow.com/questions/79400259/tf-function-decorator-on-custom-model-call-error | python, tensorflow, keras, deep-learning | 1,738,248,191 |
se_62989525 | stackoverflow | MACHINE_LEARNING | Reduce inference time of object detection model by retraining with subset of original dataset | Reduce inference time of object detection model by retraining with subset of original dataset
#newb
I'm using the MobileNet SSD v2 (COCO) object detection model to detect trains from a live camera feed.
My goal is to reduce the inference time.
The COCO dataset is available here - there's 3745 annotated images of train... | https://stackoverflow.com/questions/62989525/reduce-inference-time-of-object-detection-model-by-retraining-with-subset-of-ori | tensorflow, computer-vision, object-detection, google-coral | 1,595,225,299 |
se_59280745 | stackoverflow | MACHINE_LEARNING | Inference with TensorRT .engine file on python | Inference with TensorRT .engine file on python
I used Nvidia's Transfer Learning Toolkit(TLT) to train and then used the tlt-converter to convert the .etlt model into an .engine file.
I want to use this .engine file for inference in python. But since I trained using TLT I dont have any frozen graphs or pb files whic... | https://stackoverflow.com/questions/59280745/inference-with-tensorrt-engine-file-on-python | python, tensorflow, deep-learning, computer-vision, tensorrt | 1,576,049,355 |
se_79398527 | stackoverflow | MACHINE_LEARNING | I keep getting ModuleNotFoundError: No module named 'tensorflow.python' | I keep getting ModuleNotFoundError: No module named 'tensorflow.python'
I have to import TensorFlow to load the ResNet50 model but tensor isn't working or downloading cus of some issue.
import tensorflow as tf
This error keeps showing up when I run the code.
Traceback (most recent call last):
File "C:\Users... | https://stackoverflow.com/questions/79398527/i-keep-getting-modulenotfounderror-no-module-named-tensorflow-python | python, tensorflow | 1,738,197,052 |
se_79396982 | stackoverflow | MACHINE_LEARNING | Created TensorFlow Lite XNNPACK delegate for CPU - ('--log-level=1') doesn't work | Created TensorFlow Lite XNNPACK delegate for CPU - ('--log-level=1') doesn't work
A simple Python script (Selenium + ChromeDriver):
# import the By class, which allows you to choose how to search for an element
from selenium.webdriver.common.by import By
# initialize the browser driver. After this command... | https://stackoverflow.com/questions/79396982/created-tensorflow-lite-xnnpack-delegate-for-cpu-log-level-1-doesnt-wor | python, tensorflow, selenium-chromedriver, cpu | 1,738,159,371 |
se_54715835 | stackoverflow | MACHINE_LEARNING | Numpy is installed but still getting error | Numpy is installed but still getting error
I am trying to run jupyter notebook and getting following error.
I am using Win 7 with anaconda python 3.7.
ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in ['c:\users\paperspace\anaconda3\envs\tensorflo... | https://stackoverflow.com/questions/54715835/numpy-is-installed-but-still-getting-error | python, numpy, tensorflow | 1,550,258,483 |
se_64320883 | stackoverflow | MACHINE_LEARNING | The size of tensor a (707) must match the size of tensor b (512) at non-singleton dimension 1 | The size of tensor a (707) must match the size of tensor b (512) at non-singleton dimension 1
I am trying to do text classification using pretrained BERT model. I trained the model on my dataset, and in the phase of testing; I know that BERT can only take to 512 tokens, so I wrote if condition to check the length of t... | https://stackoverflow.com/questions/64320883/the-size-of-tensor-a-707-must-match-the-size-of-tensor-b-512-at-non-singleto | python, tensorflow, pytorch, tokenize, bert-language-model | 1,602,516,858 |
se_79374019 | stackoverflow | MACHINE_LEARNING | Getting Attribute error in Keras Classifier | Getting Attribute error in Keras Classifier
getting attribute error while passing values to keras classifier
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
from sklearn.model_selection import cross_val_score
from scikeras.wrappers import KerasClassifier
def create_model():
... | https://stackoverflow.com/questions/79374019/getting-attribute-error-in-keras-classifier | python, tensorflow, machine-learning, keras, deep-learning | 1,737,454,889 |
se_48483980 | stackoverflow | MACHINE_LEARNING | why explain logit as 'unscaled log probabililty' in sotfmax_cross_entropy_with_logits? | why explain logit as 'unscaled log probabililty' in sotfmax_cross_entropy_with_logits?
In the tensorflow documentation (softmax_cross_entropy_with_logits), they said "logits : unscaled log probablilty". What is 'log probability'?
First, I understand that 'logits' is an 'output before normalization' or a 'score... | https://stackoverflow.com/questions/48483980/why-explain-logit-as-unscaled-log-probabililty-in-sotfmax-cross-entropy-with-l | python, tensorflow, machine-learning, probability-theory | 1,517,122,821 |
se_79394023 | stackoverflow | MACHINE_LEARNING | Keras Training Issue: "Your input ran out of data" Warning and 0 Loss/Accuracy | Keras Training Issue: "Your input ran out of data" Warning and 0 Loss/Accuracy
I am training a CNN model using ImageDataGenerator with a dataset of 1500 training images and 32 batch size. I calculated the steps per epoch as
⌈1500/32⌉=47, the last batch is incomplete and I am using flow_from_directory() to lo... | https://stackoverflow.com/questions/79394023/keras-training-issue-your-input-ran-out-of-data-warning-and-0-loss-accuracy | python, tensorflow, machine-learning, keras, deep-learning | 1,738,071,552 |
se_52138920 | stackoverflow | MACHINE_LEARNING | Why do we normalize the image to mean=0.5, std=0.5? | Why do we normalize the image to mean=0.5, std=0.5?
I was lookking for GAN code in Github. The code I found uses pytorch. In this code, we first normalized the image to mean = 0.5, std = 0.5. Normally, normalize to min = 0 and max = 1. Or normal distribution with mean = 0 and std = 1. Why is this normalized to mean = ... | https://stackoverflow.com/questions/52138920/why-do-we-normalize-the-image-to-mean-0-5-std-0-5 | python, tensorflow, deep-learning, computer-vision, pytorch | 1,535,905,616 |
se_70554413 | stackoverflow | MACHINE_LEARNING | How to improve the performance of CNN Model for a specific Dataset? Getting Low Accuracy on both training and Testing Dataset | How to improve the performance of CNN Model for a specific Dataset? Getting Low Accuracy on both training and Testing Dataset
We were given an assignment in which we were supposed to implement our own neural network, and two other already developed Neural Networks. I have done that and however, this isn't the requirem... | https://stackoverflow.com/questions/70554413/how-to-improve-the-performance-of-cnn-model-for-a-specific-dataset-getting-low | tensorflow, keras, deep-learning, conv-neural-network | 1,641,110,003 |
se_79354181 | stackoverflow | MACHINE_LEARNING | tensorflow model.predict uses more and more memory | tensorflow model.predict uses more and more memory
I am using tensorflow 2.14. I have a dataset created using from_generator. I then batched the dataset to a fixed batch_size 1024. The code used is close to d1024 = from_generator(...).batch(1024).cache('cache_file').prefetch(AUTOTUNE).
Now if I do model.predict(d1024.... | https://stackoverflow.com/questions/79354181/tensorflow-model-predict-uses-more-and-more-memory | tensorflow, gpu, out-of-memory | 1,736,837,262 |
se_79377971 | stackoverflow | MACHINE_LEARNING | InvalidArgumentError: No DNN in stream executor while training a TensorFlow RetinaNet model on Google Colab | InvalidArgumentError: No DNN in stream executor while training a TensorFlow RetinaNet model on Google Colab
I'm trying to train a TensorFlow experimental model from the official TensorFlow Object Detection API, specifically a RetinaNet model. However, I encounter the following error during the training process:
restor... | https://stackoverflow.com/questions/79377971/invalidargumenterror-no-dnn-in-stream-executor-while-training-a-tensorflow-reti | python, tensorflow, machine-learning, google-colaboratory, retinanet | 1,737,554,252 |
se_54643064 | stackoverflow | MACHINE_LEARNING | how to improve the accuracy of autoencoder? | how to improve the accuracy of autoencoder?
I have an autoencoder and I checked the accuracy of my model with different solutions like changing the number of conv layer and increase them, add or remove Batch Normalization, change the activation function, but the accuracy for all of them is similar and it does not have... | https://stackoverflow.com/questions/54643064/how-to-improve-the-accuracy-of-autoencoder | python, tensorflow, keras | 1,549,947,413 |
se_48600769 | stackoverflow | MACHINE_LEARNING | Installing tensorflow on anaconda/mac? | Installing tensorflow on anaconda/mac?
I can not find a solution to install tensorflow on anaconda/mac.
When i try: conda install tensorflow,
I get:
UnsatisfiableError: The following specifications were found to be in conflict:
- blaze -> numba -> numpy=1.13
- tensorflow
Use "conda info " to see the dependencies... | https://stackoverflow.com/questions/48600769/installing-tensorflow-on-anaconda-mac | macos, tensorflow, anaconda | 1,517,683,467 |
se_70212120 | stackoverflow | MACHINE_LEARNING | TypeError: Only integers, slices, ellipsis, tf.newaxis and scalar tf.int32/tf.int64 tensors are valid indices | TypeError: Only integers, slices, ellipsis, tf.newaxis and scalar tf.int32/tf.int64 tensors are valid indices
As an exercise I am trying to train a classification model using Tensorflow v1 without using keras nor sklearn nor any other library that would greatly ease my life.. lol.
I keep getting this error though and ... | https://stackoverflow.com/questions/70212120/typeerror-only-integers-slices-ellipsis-tf-newaxis-and-scalar-tf-int32-tf-in | python, numpy, tensorflow, deep-learning | 1,638,523,994 |
se_64654700 | stackoverflow | MACHINE_LEARNING | How to create custom tensorflow metric for accuracy | How to create custom tensorflow metric for accuracy
I am trying to build a custom accuracy metric as suggested in TensorFlow docs by tracking two variables count and total.
In the update_state() method of CustomAccuracy class, I need the batch_size in order to update the variable total. As the model's batch_size is No... | https://stackoverflow.com/questions/64654700/how-to-create-custom-tensorflow-metric-for-accuracy | python, tensorflow | 1,604,359,467 |
se_78446157 | stackoverflow | MACHINE_LEARNING | SHAP DeepExplainer Error: 'tuple' object has no attribute 'as_list' 'device' | SHAP DeepExplainer Error: 'tuple' object has no attribute 'as_list' 'device'
I used shap to interpret my cnn model like this:
explainer = shap.DeepExplainer(model=model, data = X_train[0:10])
shap_values = explainer.shap_values(X_test[0:10])
When shap tries to get the output shape in its inter... | https://stackoverflow.com/questions/78446157/shap-deepexplainer-error-tuple-object-has-no-attribute-as-list-device | python, tensorflow, deep-learning, conv-neural-network, shap | 1,715,144,017 |
se_79388110 | stackoverflow | MACHINE_LEARNING | The type initializer for 'Tensorflow.Binding' threw an exception | The type initializer for 'Tensorflow.Binding' threw an exception
I want to use Tensorflow.NET (v0.150.0 by Haiping Cheng) with C# on .NET 4.7.2 and Visual Studio 2017 (because my PC is old and I don't see why I should upgrade my PC with each release of .NET).
This is my source and test code:
using System;
usin... | https://stackoverflow.com/questions/79388110/the-type-initializer-for-tensorflow-binding-threw-an-exception | c#, tensorflow | 1,737,874,669 |
se_79360053 | stackoverflow | MACHINE_LEARNING | tensorflow.keras only runs correctly once | tensorflow.keras only runs correctly once
I am using tensorflow.keras in a jupyter notebook to produce a neural network to match some real world data. The first time I run my code, it works correctly. The neural network gives a model to match the real world data. The problem is, if I try to run it again, it can't gene... | https://stackoverflow.com/questions/79360053/tensorflow-keras-only-runs-correctly-once | python, tensorflow, keras, neural-network, tensorflow2.0 | 1,736,986,819 |
se_69675958 | stackoverflow | MACHINE_LEARNING | MirroredVariable has different values on replicas (zeros, except on one device) | MirroredVariable has different values on replicas (zeros, except on one device)
Minimal example to demonstrate the problem:
import tensorflow as tf
with tf.distribute.MirroredStrategy().scope():
print(tf.Variable(1.))
Output on a 4-GPU server:
INFO:tensorflow:Using MirroredStrategy with devices ('/job:localh... | https://stackoverflow.com/questions/69675958/mirroredvariable-has-different-values-on-replicas-zeros-except-on-one-device | tensorflow, tensorflow2.0, multi-gpu, distributed-training | 1,634,901,542 |
se_79222352 | stackoverflow | MACHINE_LEARNING | Android Tensorflow tflite error.Didn't find op for builtin opcode 'FULLY_CONNECTED' version '12'. An older version of this builtin might be supported | Android Tensorflow tflite error.Didn't find op for builtin opcode 'FULLY_CONNECTED' version '12'. An older version of this builtin might be supported
Internal error: Cannot create interpreter: Didn't find op for builtin opcode 'FULLY_CONNECTED' version '12'. An older version of this builtin might b... | https://stackoverflow.com/questions/79222352/android-tensorflow-tflite-error-didnt-find-op-for-builtin-opcode-fully-connect | android, kotlin, tensorflow, tflite | 1,732,525,788 |
se_52559086 | stackoverflow | MACHINE_LEARNING | What does the accuracy mean in the Keras progress bar? | What does the accuracy mean in the Keras progress bar?
In Keras you'll have something like this:
Epoch 1/1
60000/60000 [==============================] - 297s 5ms/step - loss: 0.7048 - acc: 0.7669
60000/60000 [==============================] - 179s 3ms/step
Training Set:
acc: 94.60%
10000/10000 [==================... | https://stackoverflow.com/questions/52559086/what-does-the-accuracy-mean-in-the-keras-progress-bar | tensorflow, machine-learning, keras, deep-learning | 1,538,150,865 |
se_34190298 | stackoverflow | MACHINE_LEARNING | What's the best way to refresh TensorBoard after new events/logs were added? | What's the best way to refresh TensorBoard after new events/logs were added?
What is the best way to quickly see the updated graph in the most recent event file in an open TensorBoard session? Re-running my Python app results in a new log file being created with potentially new events/graph. However, TensorBoard d... | https://stackoverflow.com/questions/34190298/whats-the-best-way-to-refresh-tensorboard-after-new-events-logs-were-added | python, tensorflow, tensorboard | 1,449,700,439 |
se_79124139 | stackoverflow | MACHINE_LEARNING | batch is NoneType from trl dataloader for PPOTrainer, huggingface python | batch is NoneType from trl dataloader for PPOTrainer, huggingface python
My code is essentially just a copy and paste of the following huggingface article at https://huggingface.co/docs/trl/en/ppo_trainer. I have my own reward model that I have trained, and now I'm trying to execute the code below. Unfortunately I get... | https://stackoverflow.com/questions/79124139/batch-is-nonetype-from-trl-dataloader-for-ppotrainer-huggingface-python | python, tensorflow, huggingface | 1,729,825,354 |
se_48720833 | stackoverflow | MACHINE_LEARNING | Could not find a version that satisfies the requirement tensorflow | Could not find a version that satisfies the requirement tensorflow
I installed the latest version of Python (3.6.4 64-bit) and the latest version of PyCharm (2017.3.3 64-bit). Then I installed some modules in PyCharm (Numpy, Pandas, etc), but when I tried installing Tensorflow it didn't install, and I got the error me... | https://stackoverflow.com/questions/48720833/could-not-find-a-version-that-satisfies-the-requirement-tensorflow | python, python-3.x, python-2.7, tensorflow, pip | 1,518,266,144 |
se_79377187 | stackoverflow | MACHINE_LEARNING | How can I get more images after augmenting each image? | How can I get more images after augmenting each image?
I'm new to tensorflow. I want to generate more images after image augmentation but images and labels are (10, None, 400, 400, 3) and (10, None, 1) respectively and I guess it artifically count as 1 element. Which method should I use to solve this problem?
batch_si... | https://stackoverflow.com/questions/79377187/how-can-i-get-more-images-after-augmenting-each-image | tensorflow, tensor, training-data, image-augmentation | 1,737,538,747 |
se_52012010 | stackoverflow | MACHINE_LEARNING | Tensorflow Lite - ValueError: Cannot set tensor: Dimension mismatch | Tensorflow Lite - ValueError: Cannot set tensor: Dimension mismatch
This is probably going to be a stupid question but I am new to machine learning and Tensorflow.
I am trying to run object detection API on Raspberry Pi using Tensorflow Lite. I am trying to modify my code with the help of this example
https://github.... | https://stackoverflow.com/questions/52012010/tensorflow-lite-valueerror-cannot-set-tensor-dimension-mismatch | python, tensorflow, raspberry-pi, object-detection, tensorflow-lite | 1,535,146,517 |
se_78215569 | stackoverflow | MACHINE_LEARNING | I can't get reproducible results with keras neural networks | I can't get reproducible results with keras neural networks
As the title says. I'm currently working in python (3.11) with keras (2.12.0) and tensorflow (2.12.1, cpu-only package) libraries, and I'm facing some problems with the reproducibility of my neural networks; currently coding in jupyter notebook. I'm using... | https://stackoverflow.com/questions/78215569/i-cant-get-reproducible-results-with-keras-neural-networks | python, tensorflow, keras, jupyter-notebook | 1,711,303,349 |
se_53825156 | stackoverflow | MACHINE_LEARNING | tensorflow keras sequence models - how to only predict output of last step | tensorflow keras sequence models - how to only predict output of last step
I am developing a sequence model by using tf.keras library.
Assume that I have 5 time steps and each time step essentially has an output.
Number of features in each time step is - say - 4. And I am working on a classification problem and the ou... | https://stackoverflow.com/questions/53825156/tensorflow-keras-sequence-models-how-to-only-predict-output-of-last-step | tensorflow, machine-learning, keras, lstm, recurrent-neural-network | 1,545,096,293 |
se_79369471 | stackoverflow | MACHINE_LEARNING | Why do the layers CenterCrop and Resizing automatically set training=true? | Why do the layers CenterCrop and Resizing automatically set training=true?
Here is a minimal example reproducing the effect:
from keras import Model
from keras.layers import Conv2D, CenterCrop, Input, GlobalMaxPooling2D, Resizing
inputs = [Input(shape=(256, 256, 3))]
outputs = [
Conv2D(8, (3, 3))(inputs[0]),
... | https://stackoverflow.com/questions/79369471/why-do-the-layers-centercrop-and-resizing-automatically-set-training-true | tensorflow, keras | 1,737,309,109 |
se_78506207 | stackoverflow | MACHINE_LEARNING | ONNX I/O Binding | ONNX I/O Binding
I need to bind tensor input and output using I/O Binding for ONNX runtime model. but i didn't get output. the output tensor return NULL pointer. I will attached the code below.
std::vector<Ort::Value> input_tensors;
std::vector<Ort::Value> output_tensors;
std::vector<const char*> input_node_names_c_st... | https://stackoverflow.com/questions/78506207/onnx-i-o-binding | c++, performance, tensorflow, onnxruntime | 1,716,202,749 |
se_33616593 | stackoverflow | MACHINE_LEARNING | How do I use distributed DNN training in TensorFlow? | How do I use distributed DNN training in TensorFlow?
Google released TensorFlow today.
I have been poking around in the code, and I don't see anything in the code or API about training across a cluster of GPU servers.
Does it have distributed training functionality yet? | https://stackoverflow.com/questions/33616593/how-do-i-use-distributed-dnn-training-in-tensorflow | python, parallel-processing, deep-learning, tensorflow | 1,447,097,002 |
se_78870882 | stackoverflow | MACHINE_LEARNING | Only instances of `keras.Layer` can be added to a Sequential model | Only instances of `keras.Layer` can be added to a Sequential model
I encountered an error related to Sequential while working with TensorFlow Hub. Can anyone help me with this?"
enter image description here
"ValueError: Only instances of keras.Layer can be added to a Sequential model. Received: <tensorflow_hub.keras_l... | https://stackoverflow.com/questions/78870882/only-instances-of-keras-layer-can-be-added-to-a-sequential-model | python, tensorflow, keras, keras-layer, tensorflow-hub | 1,723,638,076 |
se_79373655 | stackoverflow | MACHINE_LEARNING | Discrepancies between tensorflow and pytorch while maintaining batch size, loss functions, architectures, metric, data, optimizer | Discrepancies between tensorflow and pytorch while maintaining batch size, loss functions, architectures, metric, data, optimizer
It is a follow up question to Investigating discrepancies in TensorFlow and PyTorch performance
The author stated that there is a performance gap between Pytorch and Tensorflow while mainta... | https://stackoverflow.com/questions/79373655/discrepancies-between-tensorflow-and-pytorch-while-maintaining-batch-size-loss | python, tensorflow, machine-learning, pytorch, neural-network | 1,737,448,026 |
se_69364068 | stackoverflow | MACHINE_LEARNING | Loading tf.keras model, ValueError: The two structures don't have the same nested structure | Loading tf.keras model, ValueError: The two structures don't have the same nested structure
I created a tf.keras model that has BERT and I want to train and save it for further use.
Loading this model is a big issue cause I keep getting error: ValueError: The two structures don't have the same nested structure.
I ... | https://stackoverflow.com/questions/69364068/loading-tf-keras-model-valueerror-the-two-structures-dont-have-the-same-neste | python, tensorflow, keras, huggingface-transformers, bert-language-model | 1,632,841,026 |
se_79371395 | stackoverflow | MACHINE_LEARNING | Dst tensor not initialising, Memory allocatiion | Dst tensor not initialising, Memory allocatiion
I am having issue with a Dst tensor not initializing, there are similar posts but the solutions there are too outdated and my issue is pretty specific
I am running:
python - 3.11,
Tensorflow - 2.15,
Keras - 2.15,
tensorflow_metal - 2.15
I am using version 2.15 to ensure ... | https://stackoverflow.com/questions/79371395/dst-tensor-not-initialising-memory-allocatiion | python, tensorflow, keras, neural-network | 1,737,377,914 |
se_79372107 | stackoverflow | MACHINE_LEARNING | TensorFlow Import Works in Jupyter Notebook, but Fails in Python Script | TensorFlow Import Works in Jupyter Notebook, but Fails in Python Script
Problem: import tensorflow as tf causes an error in the Conda environment
I am trying to import TensorFlow and Keras in a Python script using the following command:
import tensorflow as tf
print("TensorFlow and Keras are imported successfully!")
... | https://stackoverflow.com/questions/79372107/tensorflow-import-works-in-jupyter-notebook-but-fails-in-python-script | python, tensorflow, keras, jupyter-notebook, importerror | 1,737,392,356 |
se_79368494 | stackoverflow | MACHINE_LEARNING | Tensorflow is unable to train to predict simple multiplication | Tensorflow is unable to train to predict simple multiplication
As a starting point i am trying to create a neural network that predicts simple multiplication, with the goal to change the formula at the later date. My initial thought was that it would be trivial to do, and the code itself is quite simple, but the model... | https://stackoverflow.com/questions/79368494/tensorflow-is-unable-to-train-to-predict-simple-multiplication | python-3.x, tensorflow, multiplication | 1,737,267,149 |
se_79370074 | stackoverflow | MACHINE_LEARNING | Why does tensorflow loss go to infinity with larger training set? | Why does tensorflow loss go to infinity with larger training set?
I've created a very simple tensorflow model and it works if I have one set of training data. However, if I add just one more training example then the loss goes to infinity and the model doesn't work. This is even though the model for the two examples... | https://stackoverflow.com/questions/79370074/why-does-tensorflow-loss-go-to-infinity-with-larger-training-set | tensorflow, loss | 1,737,334,363 |
se_76720919 | stackoverflow | MACHINE_LEARNING | TensorFlow 2.13.0 Protobuf FATAL ERROR on Inference C++ test | TensorFlow 2.13.0 Protobuf FATAL ERROR on Inference C++ test
I just compiled TensorFlow 2.13.0, on Slackware with kernel 4.19.288 with nvidia Driver Version: 535.54.03 and CUDA Version: 12.2, C++ APIs. When I try to start compiled inference test it gives me this error:
[libprotobuf ERROR external/com_google_protobuf/s... | https://stackoverflow.com/questions/76720919/tensorflow-2-13-0-protobuf-fatal-error-on-inference-c-test | tensorflow, c++17, protocol-buffers, tensorflow2.0 | 1,689,766,810 |
se_67933482 | stackoverflow | MACHINE_LEARNING | Keras Tuner Hyperband - how to set max trials and max epochs? | Keras Tuner Hyperband - how to set max trials and max epochs?
I have two questions regarding the Keras Tuner Hyperband class (for a regression problem)
tuner = kerastuner.tuners.hyperband.Hyperband(hypermodel,
objective,
max_epochs,
... | https://stackoverflow.com/questions/67933482/keras-tuner-hyperband-how-to-set-max-trials-and-max-epochs | tensorflow, keras, keras-tuner | 1,623,399,115 |
se_37231866 | stackoverflow | MACHINE_LEARNING | How do I set up TensorFlow in the Google cloud? | How do I set up TensorFlow in the Google cloud?
How do I set up a TensorFlow in the Google cloud? I understand how to create a Google Compute Engine instance, and how to run TensorFlow locally; and a recent Google blog post suggests that there ought to be a way to create a Google Compute Engine instance and run Tensor... | https://stackoverflow.com/questions/37231866/how-do-i-set-up-tensorflow-in-the-google-cloud | tensorflow, machine-learning, google-cloud-platform, google-cloud-ml, google-cloud-tpu | 1,463,259,928 |
se_43992230 | stackoverflow | MACHINE_LEARNING | TensorFlow in nvidia-docker: failed call to cuInit: CUDA_ERROR_UNKNOWN | TensorFlow in nvidia-docker: failed call to cuInit: CUDA_ERROR_UNKNOWN
I have been working on getting an application that relies on TensorFlow to work as a docker container with nvidia-docker. I have compiled my application on top of the tensorflow/tensorflow:latest-gpu-py3 image. I run my docker container with the fo... | https://stackoverflow.com/questions/43992230/tensorflow-in-nvidia-docker-failed-call-to-cuinit-cuda-error-unknown | python, docker, tensorflow, gpu, nvidia | 1,494,906,971 |
se_79368759 | stackoverflow | MACHINE_LEARNING | Tensorflow Probability MixtureNormal layer example not working as in example | Tensorflow Probability MixtureNormal layer example not working as in example
Tensorflow version is 2.17.1
Tensoflow probability version is 0.24.0
Example from the documentation https://www.tensorflow.org/probability/api_docs/python/tfp/layers/MixtureNormal?hl=en is the following:
import numpy as np
import tensorflow a... | https://stackoverflow.com/questions/79368759/tensorflow-probability-mixturenormal-layer-example-not-working-as-in-example | python, tensorflow, tensorflow2.0, tensorflow-probability | 1,737,281,362 |
se_66984809 | stackoverflow | MACHINE_LEARNING | How to check the version of NCCL | How to check the version of NCCL
I remotely access High-performance computing nodes. I am not sure about NVIDIA Collective Communications Library (NCCL) is installed in my directory or not. Is there any way to check whether the NCCL is installed or not? | https://stackoverflow.com/questions/66984809/how-to-check-the-version-of-nccl | python, tensorflow, nvidia, horovod | 1,617,793,551 |
se_68617488 | stackoverflow | MACHINE_LEARNING | How do I convert a Coqui Tensorflow model to .tflite? | How do I convert a Coqui Tensorflow model to .tflite?
I have the Coqui STT yesno model from GitHub, which is an ultra-compact speech recognition model that only recognises two words: yes and no.
I have the yesno.pbmm and yesno.scorer files.
I also have a tarball coqui-yesno-checkpoints.tar.gz containing the following ... | https://stackoverflow.com/questions/68617488/how-do-i-convert-a-coqui-tensorflow-model-to-tflite | tensorflow, speech-to-text, tensorflow-lite, coqui | 1,627,887,238 |
se_79367409 | stackoverflow | MACHINE_LEARNING | How to pass sample weights to Keras multi output model | How to pass sample weights to Keras multi output model
I have mixed type multiple output (one regression and one classification) Keras model. I am trying to pass the same sample weights for both outputs as below.
import numpy as np
import tensorflow as tf
from tensorflow import keras
# Generate some sample data
np.ra... | https://stackoverflow.com/questions/79367409/how-to-pass-sample-weights-to-keras-multi-output-model | python, tensorflow, machine-learning, keras | 1,737,213,851 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.