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_43771395 | stackoverflow | MACHINE_LEARNING | How can I change the network dynamically in tensorflow? | How can I change the network dynamically in tensorflow?
I have a deep fully connected network.
I want to be able to change the structure of middle layers of the network dynamically.
What is the best way of doing that?
What I did right now is to create an output placeholder for my network. I thought I will create a net... | https://stackoverflow.com/questions/43771395/how-can-i-change-the-network-dynamically-in-tensorflow | tensorflow, neural-network | 1,493,852,982 |
se_41143056 | stackoverflow | MACHINE_LEARNING | How to change the value of variables each iteration after the graph is built? | How to change the value of variables each iteration after the graph is built?
I want to change the value of the variables manually in each iteration in Tensorflow, but i don't want to change the gradient computation. How to do it? | https://stackoverflow.com/questions/41143056/how-to-change-the-value-of-variables-each-iteration-after-the-graph-is-built | tensorflow, machine-learning | 1,481,719,642 |
se_79499140 | stackoverflow | MACHINE_LEARNING | How to easily modify the number of neurons of a certain layer in a Tensorflow neural network? | How to easily modify the number of neurons of a certain layer in a Tensorflow neural network?
In tensorflow, given a model h = Model(input_layer, output_layer) for example (its summary looks like below)
Model: "functional_1"
βββββββββββββββββββββββββββββββββββ³βββββββββββββββββββββββββ³ββββββββββββββββ
β Layer (type) ... | https://stackoverflow.com/questions/79499140/how-to-easily-modify-the-number-of-neurons-of-a-certain-layer-in-a-tensorflow-ne | python, tensorflow, keras, deep-learning | 1,741,640,186 |
se_78241816 | stackoverflow | MACHINE_LEARNING | Pycharm debug is not working with Tensorflow. How do I resolve it? | Pycharm debug is not working with Tensorflow. How do I resolve it?
I have successfully installed the following:
tensorflow (latest version 2.16.1)
keras (latest version 3.1.1
I am using pycharm 2023.3.5 (community Edition). I have some lines of codes with imports including tensorflow:
...
from tensorflow.keras impor... | https://stackoverflow.com/questions/78241816/pycharm-debug-is-not-working-with-tensorflow-how-do-i-resolve-it | python-3.x, tensorflow, machine-learning | 1,711,682,246 |
se_74751742 | stackoverflow | MACHINE_LEARNING | Sentiment analysis model return identical output for any input | Sentiment analysis model return identical output for any input
So I made this sentiment analysis model, and it works just fine in the training-testing script. I built a simple interface using streamlit for my saved model, but it always returned identical scores for any input text. Plus, it somehow returns so many scor... | https://stackoverflow.com/questions/74751742/sentiment-analysis-model-return-identical-output-for-any-input | python, tensorflow, keras, sentiment-analysis, streamlit | 1,670,664,454 |
se_58202095 | stackoverflow | MACHINE_LEARNING | Can't import tensorflow.keras in VS Code | Can't import tensorflow.keras in VS Code
I'm running into problems using tensorflow 2 in VS Code. The code executes without a problem, the errors are just related to pylint in VS Code.
For example this import from tensorflow.keras.layers import Dense gives a warning "Unable to import 'tensorflow.keras.layers'pyli... | https://stackoverflow.com/questions/58202095/cant-import-tensorflow-keras-in-vs-code | python, tensorflow, keras, visual-studio-code | 1,570,021,358 |
se_79285532 | stackoverflow | MACHINE_LEARNING | Multi-GPU training in Tensorflow results in Nans | Multi-GPU training in Tensorflow results in Nans
I am trying to train using multiple GPUs, however the loss is always Nan after a few steps. If I use a single GPU, then its fine. Below shows a dummy script that results in nan's after a few steps. Below the code shows the output of the print statements I placed at the ... | https://stackoverflow.com/questions/79285532/multi-gpu-training-in-tensorflow-results-in-nans | python, tensorflow, gpu, multi-gpu | 1,734,369,679 |
se_79498572 | stackoverflow | MACHINE_LEARNING | Tensorflow C API - How to use Tensorflow Text? | Tensorflow C API - How to use Tensorflow Text?
I am trying to run a pre-trained model (The MuRIL model). However, it seems that it requires the tensorflow_text package.
When running the saved model with python, this is simple:
import tensorflow as tf
import tensorflow_text # important to load RegexSplitWithOffsets
pr... | https://stackoverflow.com/questions/79498572/tensorflow-c-api-how-to-use-tensorflow-text | c, linux, tensorflow, ubuntu, fedora | 1,741,623,478 |
se_79439790 | stackoverflow | MACHINE_LEARNING | Non deterministic behavior of a CNN network after adding self attention | Non deterministic behavior of a CNN network after adding self attention
When I added NLBloclos, a self-attention layer to my network (simple CNN) the result of the network was not reproducible anymore, when I trained it again, the result was different. But when I remove the NLBlocks in the network it is deterministic.... | https://stackoverflow.com/questions/79439790/non-deterministic-behavior-of-a-cnn-network-after-adding-self-attention | tensorflow, machine-learning, keras, conv-neural-network, self-attention | 1,739,545,725 |
se_79352104 | stackoverflow | MACHINE_LEARNING | Why the even epochs are not giving appropriate results in binary classification problem | Why the even epochs are not giving appropriate results in binary classification problem
I wanted to do image classification using CNN and now I am getting abnormal results cause the even no of epochs are not working as expected even if i change the no of epochs
import os
import numpy as np
import pandas as pd
import m... | https://stackoverflow.com/questions/79352104/why-the-even-epochs-are-not-giving-appropriate-results-in-binary-classification | python, tensorflow, deep-learning, conv-neural-network, artificial-intelligence | 1,736,769,307 |
se_63718559 | stackoverflow | MACHINE_LEARNING | Finding most similar sentences among all in python | Finding most similar sentences among all in python
I have a data which is having more than 1500 rows. Each row has a sentence. I am trying to find out the best method to find the most similar sentences among all.
What I have tried
I have tried K-mean algorithm which groups similar sentences in a cluster. But I found ... | https://stackoverflow.com/questions/63718559/finding-most-similar-sentences-among-all-in-python | python, tensorflow, scikit-learn, sentence-similarity | 1,599,117,055 |
se_79496727 | stackoverflow | MACHINE_LEARNING | Memory leak with Tensorflow v2.10 TF_LoadSessionFromSavedModel() | Memory leak with Tensorflow v2.10 TF_LoadSessionFromSavedModel()
I'm using C++ with the Tensorflow C API (v2.10) to run a model and I noticed memory leaks occurring in my implementation, so I decided to do some digging. I found that even without creating any tensors or calling TF_SessionRun() the TF_LoadSessionFromSav... | https://stackoverflow.com/questions/79496727/memory-leak-with-tensorflow-v2-10-tf-loadsessionfromsavedmodel | c#, c++, tensorflow | 1,741,560,723 |
se_68116676 | stackoverflow | MACHINE_LEARNING | Model Load get different result after restart runtime | Model Load get different result after restart runtime
I have written a Resnet50 model using google colab. After train my model then saving models afterwards load model without restart run time get same result, but when restarting runtime google colab and running xtrain, ytest, x_val, y_val then loading model again, I ... | https://stackoverflow.com/questions/68116676/model-load-get-different-result-after-restart-runtime | python, tensorflow, machine-learning, neural-network | 1,624,541,112 |
se_77610686 | stackoverflow | MACHINE_LEARNING | Why does the one-hot-encoding give worse accuracy in this case? | Why does the one-hot-encoding give worse accuracy in this case?
I have two directories, train_data_npy and valid_data_npy where there are 3013 and 1506 *.npy files, respectively.
Each *.npy file has 11 columns of float types, of which the first eight columns are features and the last three columns are one-hot-encoded ... | https://stackoverflow.com/questions/77610686/why-does-the-one-hot-encoding-give-worse-accuracy-in-this-case | python, tensorflow, machine-learning, keras, auto-keras | 1,701,839,528 |
se_70239943 | stackoverflow | MACHINE_LEARNING | Error to import Network from keras.engine.topolgy | Error to import Network from keras.engine.topolgy
I installed the topology package by downgrading the keras (pip install 'keras==2.1.6' --force-reinstall), because it doesn't exist in newer versions. I am still getting an error to import Network.
Trying:
from keras.engine.topology import Network
Error:
ImportError: c... | https://stackoverflow.com/questions/70239943/error-to-import-network-from-keras-engine-topolgy | tensorflow, machine-learning, keras, deep-learning, tensorflow2.0 | 1,638,753,152 |
se_61911032 | stackoverflow | MACHINE_LEARNING | AttributeError: keras.backend has no attribute 'eager' | AttributeError: keras.backend has no attribute 'eager'
I'm using python 3.8.2 , keras 2.3.1 and tensorflow 2.2.0rc4 .
just with the following code :
import keras
from keras.models import sequential
I have this error :
AttributeError: partially initialized module 'keras.backend' has no attribute
'eager' (mo... | https://stackoverflow.com/questions/61911032/attributeerror-keras-backend-has-no-attribute-eager | python, tensorflow, keras | 1,589,971,255 |
se_59847045 | stackoverflow | MACHINE_LEARNING | Should I use @tf.function for all functions? | Should I use @tf.function for all functions?
An official tutorial on @tf.function says:
To get peak performance and to make your model deployable anywhere,
use tf.function to make graphs out of your programs. Thanks to
AutoGraph, a surprising amount of Python code just works with
tf.function, but there are s... | https://stackoverflow.com/questions/59847045/should-i-use-tf-function-for-all-functions | tensorflow, keras, tensorflow2.0, tf.keras, tensorflow2.x | 1,579,630,870 |
se_46491112 | stackoverflow | MACHINE_LEARNING | protoc object_detection/protos/*.proto: No such file or directory | protoc object_detection/protos/*.proto: No such file or directory
I am following the example found here.
But whenever I enter the command
C:/Program Files/protoc/bin/protoc object_detection/protos/*.proto --python_out=.
I get an error that says
object_detection/protos/*.proto: No such file or directory.
I can't cre... | https://stackoverflow.com/questions/46491112/protoc-object-detection-protos-proto-no-such-file-or-directory | python, tensorflow, object-detection, protoc | 1,506,695,637 |
se_79493803 | stackoverflow | MACHINE_LEARNING | In my Tensorflow model, why is the output of this concatenation the wrong shape? It should be (Batch size, 14850) but its (Batch size, 1053)? | In my Tensorflow model, why is the output of this concatenation the wrong shape? It should be (Batch size, 14850) but its (Batch size, 1053)?
After passing an input sequence to a 1D CNN, I'm trying to combine the output with some engineered features about the sequence. The input sequence is shape (29,1) and the input ... | https://stackoverflow.com/questions/79493803/in-my-tensorflow-model-why-is-the-output-of-this-concatenation-the-wrong-shape | python, tensorflow, keras, deep-learning, conv-neural-network | 1,741,402,505 |
se_50610557 | stackoverflow | MACHINE_LEARNING | How to mark one function not a test for pytest? | How to mark one function not a test for pytest?
I'm using pytest to test some code based on TensorFlow.
A TestCase is defined for simplicity like:
class TestCase(tf.test.TestCase):
# ...
The problem is tf.test.TestCase provide a useful function self.test_session(), which was treated as a test method in pytest ... | https://stackoverflow.com/questions/50610557/how-to-mark-one-function-not-a-test-for-pytest | python, unit-testing, tensorflow, pytest | 1,527,701,757 |
se_60849474 | stackoverflow | MACHINE_LEARNING | How to download the cuDNN straight from nvidia website to my linux instance on GCP | How to download the cuDNN straight from nvidia website to my linux instance on GCP
I want to install tensorflow-gpu on my linux machine on google cloud platform. I am not using an deep learning vm gcp provide. So I installed anaconda on my linux instance and now i want to install tensorflow. I already installed nvidia... | https://stackoverflow.com/questions/60849474/how-to-download-the-cudnn-straight-from-nvidia-website-to-my-linux-instance-on-g | tensorflow, google-compute-engine, ubuntu-16.04, nvidia, cudnn | 1,585,141,535 |
se_64848149 | stackoverflow | MACHINE_LEARNING | split dataset into train and test using tensorflow | split dataset into train and test using tensorflow
How can I shuffle and split my full dataset into train and test sets using Tensorflow? I don't want to use scikit-learn's train-test-split. | https://stackoverflow.com/questions/64848149/split-dataset-into-train-and-test-using-tensorflow | tensorflow, machine-learning, train-test-split | 1,605,464,431 |
se_78414951 | stackoverflow | MACHINE_LEARNING | Error when running app that uses tensorflow and pyinstaller | Error when running app that uses tensorflow and pyinstaller
very good everyone, thank you for going into my problem, so I'm going to get to the point, it turns out that when I compile with pyinstaller everything works well, tensorflow is imported correctly, I don't see any problems when importing the h5 model either, ... | https://stackoverflow.com/questions/78414951/error-when-running-app-that-uses-tensorflow-and-pyinstaller | python, tensorflow, compilation, pyinstaller, execute | 1,714,582,367 |
se_74715356 | stackoverflow | MACHINE_LEARNING | About tensorflow-wavelets | About tensorflow-wavelets
I'm trying to use the tensorflow-wavelets to use it as a layer. Everything so far is great, the problem is that my inputs are signal sequences, and when I run the code, it gives me error 1 below. When I searched in the code of the tensorflow-wavelets, I found out that the code used padding, w... | https://stackoverflow.com/questions/74715356/about-tensorflow-wavelets | numpy, tensorflow, activation-function, pywavelets | 1,670,409,829 |
se_55371035 | stackoverflow | MACHINE_LEARNING | Installing Tensorflow 1.9 offline and manually | Installing Tensorflow 1.9 offline and manually
I am working on an offline Ubuntu 16.04 workstation using python 2.7. I cannot install the tensorflow library via pip,the internet or any other conventional methods.
On the remote system, I will be installing tensorflow 1.9 manually using downloaded .so files and .whl fi... | https://stackoverflow.com/questions/55371035/installing-tensorflow-1-9-offline-and-manually | python, tensorflow | 1,553,667,901 |
se_64227483 | stackoverflow | MACHINE_LEARNING | What is the right way to gradually unfreeze layers in neural network while learning with tensorflow? | What is the right way to gradually unfreeze layers in neural network while learning with tensorflow?
I use transfer leaning with efficientnet_B0, and what im trying to do is to gradually unfreeze layers while network is learning. At first, I train 1 dense layer on top of whole network, while every other layer is froze... | https://stackoverflow.com/questions/64227483/what-is-the-right-way-to-gradually-unfreeze-layers-in-neural-network-while-learn | python, tensorflow, keras, deep-learning, neural-network | 1,601,993,128 |
se_49473369 | stackoverflow | MACHINE_LEARNING | Offline Speech Recognition in browser | Offline Speech Recognition in browser
I am working on a product that need to take inputs from user and do certain actions based on it. We have implemented it with a chat box via typing and it is serving our purpose. For the future releases we want to add voice recognition to the chat window. We thought of using
w... | https://stackoverflow.com/questions/49473369/offline-speech-recognition-in-browser | tensorflow, speech-recognition, speech-to-text, google-speech-api | 1,521,961,608 |
se_77983502 | stackoverflow | MACHINE_LEARNING | What happens to install tensorflow? | What happens to install tensorflow?
When I try to install tensorflow using pip install tensorflow in cmd python version 3.12.1. Its give error like ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
Anyone help me please!... | https://stackoverflow.com/questions/77983502/what-happens-to-install-tensorflow | tensorflow, keras | 1,707,761,815 |
se_79482033 | stackoverflow | MACHINE_LEARNING | Cannot run ProtNLM from Uniprot with Tensorflow in colab notebook | Cannot run ProtNLM from Uniprot with Tensorflow in colab notebook
I am interested in running Uniprot's Protein descriptor model, ProtNLM, to add some bonus descriptors for a big chunk of protein sequence I have.
They have a trial notebook available here.
Here is the full code of the notebook:
!python3 -m pip install -... | https://stackoverflow.com/questions/79482033/cannot-run-protnlm-from-uniprot-with-tensorflow-in-colab-notebook | python, tensorflow, bioinformatics | 1,741,032,618 |
se_79484601 | stackoverflow | MACHINE_LEARNING | Android mediapipe second inference instance can't be initialized | Android mediapipe second inference instance can't be initialized
I do some experiments with google.mediapipe framework and observing next issue... if some instance/task was initialized, it's impossible to create another instance of inference task after.
For example, I run mediapipe task with pose detection model, ... | https://stackoverflow.com/questions/79484601/android-mediapipe-second-inference-instance-cant-be-initialized | android, tensorflow, machine-learning, mediapipe | 1,741,113,985 |
se_79484194 | stackoverflow | MACHINE_LEARNING | Warning when loading the model because of Adam optimizer | Warning when loading the model because of Adam optimizer
I am implementing the following multi-task model with the following layers:
@tf.keras.utils.register_keras_serializable()
class Bcb_block(Layer):
def __init__(self, mid_chan, out_chan, data_format = 'channels_first', **kwargs):
super(Bcb_block, self)... | https://stackoverflow.com/questions/79484194/warning-when-loading-the-model-because-of-adam-optimizer | python, tensorflow, machine-learning, deep-learning, tf.keras | 1,741,103,282 |
se_79396860 | stackoverflow | MACHINE_LEARNING | Always getting ' Your input ran out of data' | Always getting ' Your input ran out of data'
I am trying to train a CNN model with an image dataset for medical image segmentation:
history = model.fit(x = train_dataset,
validation_data = val_dataset,
epochs= epochs,
steps_per_epoch= st... | https://stackoverflow.com/questions/79396860/always-getting-your-input-ran-out-of-data | python, tensorflow, machine-learning, keras | 1,738,156,541 |
se_79485457 | stackoverflow | MACHINE_LEARNING | CycleGAN Training Log: Constant Adversarial Loss & Discriminator Accuracy Stabilization at ~49% | CycleGAN Training Log: Constant Adversarial Loss & Discriminator Accuracy Stabilization at ~49%
Issue Description:
I am running CycleGAN training using Keras v3.8.0 and have observed the following behavior during the initial epoch (0/200):
Discriminator (D):
The D loss starts around 0.70 (e.g., 0.695766 at batch 0... | https://stackoverflow.com/questions/79485457/cyclegan-training-log-constant-adversarial-loss-discriminator-accuracy-stabil | tensorflow, keras | 1,741,149,362 |
se_73463502 | stackoverflow | MACHINE_LEARNING | Input 0 of layer "conv2d" is incompatible with the layer expected axis -1 of input shape to have value 3 | Input 0 of layer "conv2d" is incompatible with the layer expected axis -1 of input shape to have value 3
How to solve this error?
Preprocessing of image:
def PreprocessData(img, mask, target_shape_img, target_shape_mask, path1, path2):
"""
Processes the images and mask present in the shared list and ... | https://stackoverflow.com/questions/73463502/input-0-of-layer-conv2d-is-incompatible-with-the-layer-expected-axis-1-of-inp | python, tensorflow | 1,661,279,023 |
se_71399091 | stackoverflow | MACHINE_LEARNING | Gradients are None while implementing GradCam | Gradients are None while implementing GradCam
I am trying to implement grad-cam for a tensorflow 2.0 model (created using the keras-api), but the gradients returned from the tape are always None.
I am following the example given on https://keras.io/examples/vision/grad_cam/.
My model is fairly simple, but I swapped it... | https://stackoverflow.com/questions/71399091/gradients-are-none-while-implementing-gradcam | python, tensorflow, keras, tensorflow2.0 | 1,646,760,101 |
se_79480858 | stackoverflow | MACHINE_LEARNING | TypeError: __init__(): incompatible constructor arguments | TypeError: __init__(): incompatible constructor arguments
I have trained a model ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8 in tensorflow api but when training the model, I have an error message:
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
1. tensorflow... | https://stackoverflow.com/questions/79480858/typeerror-init-incompatible-constructor-arguments | python, tensorflow | 1,741,001,196 |
se_79469988 | stackoverflow | MACHINE_LEARNING | Issues converting Tensorflow model with float64 operations to TFLite | Issues converting Tensorflow model with float64 operations to TFLite
I am looking to compile this model as a TFLite model, but since the model utilises float64 operations I am running into issues with it. I hope someone has some insights here on whether it is at all possible to convert this to a TFLite model and if so... | https://stackoverflow.com/questions/79469988/issues-converting-tensorflow-model-with-float64-operations-to-tflite | tensorflow, floating-point, tflite | 1,740,578,058 |
se_44544766 | stackoverflow | MACHINE_LEARNING | How do I check if keras is using gpu version of tensorflow? | How do I check if keras is using gpu version of tensorflow?
When I run a keras script, I get the following output:
Using TensorFlow backend.
2017-06-14 17:40:44.621761: W
tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow
library wasn't compiled to use SSE4.1 instructions, but these are
available on ... | https://stackoverflow.com/questions/44544766/how-do-i-check-if-keras-is-using-gpu-version-of-tensorflow | python, tensorflow, neural-network, keras | 1,497,443,146 |
se_54513742 | stackoverflow | MACHINE_LEARNING | How do I get probability/confidence as output for a CNN using keras in python? | How do I get probability/confidence as output for a CNN using keras in python?
So, I'm new to deep learning and I've started with cats and dogs dataset for a CNN Model using Keras.
In my code, I'm unable to get probabilities as output for both classifier.predict or classifier.predict_proba. I'm just getting the output... | https://stackoverflow.com/questions/54513742/how-do-i-get-probability-confidence-as-output-for-a-cnn-using-keras-in-python | python, tensorflow, keras, neural-network, conv-neural-network | 1,549,274,430 |
se_79478810 | stackoverflow | MACHINE_LEARNING | How Come Memory Footprint of a Tensorflow Model is Increasing After tflite Conversion? | How Come Memory Footprint of a Tensorflow Model is Increasing After tflite Conversion?
Trained a simple tensorflow model containing some LSTM and Dense feed-forward layers. After training, I am quantising and converting the model to a tf.lite format for edge deployment. Here is the relevant part of the code.
...
model... | https://stackoverflow.com/questions/79478810/how-come-memory-footprint-of-a-tensorflow-model-is-increasing-after-tflite-conve | python, tensorflow, machine-learning, tflite | 1,740,905,049 |
se_44088706 | stackoverflow | MACHINE_LEARNING | "Cannot convert a ndarray into a Tensor or Operation." error when trying to fetch a value from session.run in tensorflow | "Cannot convert a ndarray into a Tensor or Operation." error when trying to fetch a value from session.run in tensorflow
I have created a siamese network in tensorflow. I am calculating the distance between two tensors using the below code:
distance = tf.sqrt(tf.reduce_sum(tf.square(tf.subtract(question1_pr... | https://stackoverflow.com/questions/44088706/cannot-convert-a-ndarray-into-a-tensor-or-operation-error-when-trying-to-fetc | python, numpy, tensorflow | 1,495,300,152 |
se_38120008 | stackoverflow | MACHINE_LEARNING | Anaconda & Tensorflow & Skflow: dnn() got an unexpected keyword argument 'keep_prob' | Anaconda & Tensorflow & Skflow: dnn() got an unexpected keyword argument 'keep_prob'
When running this example in Anaconda 2.7:
import tensorflow.contrib.learn as skflow
def DNN_model(X, y):
"""This is DNN with 50, 20, 10 hidden layers, and dropout of 0.5 probability."""
layers = skflow.ops.dn... | https://stackoverflow.com/questions/38120008/anaconda-tensorflow-skflow-dnn-got-an-unexpected-keyword-argument-keep-p | python, tensorflow, anaconda | 1,467,281,227 |
se_44497187 | stackoverflow | MACHINE_LEARNING | Why are weights and biases necessary in Neural networks? | Why are weights and biases necessary in Neural networks?
Regarding neural networks, why do we need weights and biases?
For weights I've had this intuition that we're trying to multiply certain constants to the inputs such that we could reach the value of y and know the relation, kinda' like y = mx + c. Please help me ... | https://stackoverflow.com/questions/44497187/why-are-weights-and-biases-necessary-in-neural-networks | machine-learning, tensorflow, neural-network | 1,497,263,255 |
se_67236791 | stackoverflow | MACHINE_LEARNING | Asking advice on EEG classification using Keras | Asking advice on EEG classification using Keras
I have a dataset on EEG, with this shape:
(11,1158, 200)
Where
11 is the number of EEG channel
1158 is the number of each task
200 is the time interval of each task
for example, if you plot a task, you'll get (Note that the data is normalized):
This task represents a ... | https://stackoverflow.com/questions/67236791/asking-advice-on-eeg-classification-using-keras | python, tensorflow, machine-learning, keras | 1,619,211,711 |
se_75272745 | stackoverflow | MACHINE_LEARNING | Grad Cam outputs for all the images are the same | Grad Cam outputs for all the images are the same
I am using grad cam to see which regions of the test images are most important for the prediction of resnet50. The output I got has some errors.
Code Snippets:
from tensorflow.keras.models import Model
import tensorflow as tf
import numpy as np
import cv2
class GradCAM... | https://stackoverflow.com/questions/75272745/grad-cam-outputs-for-all-the-images-are-the-same | python, tensorflow, keras, conv-neural-network, visualization | 1,674,969,353 |
se_73533170 | stackoverflow | MACHINE_LEARNING | My Neural network is perfroming regression instead of classification | My Neural network is perfroming regression instead of classification
I am working on a Data Science project which requires implementation of a neural network. The dataset I am providing for training is not sequential and has class labels. But I don't know why it is treating it as sequence of events.
I am using the fol... | https://stackoverflow.com/questions/73533170/my-neural-network-is-perfroming-regression-instead-of-classification | python, tensorflow, machine-learning, scikit-learn, neural-network | 1,661,797,668 |
se_79467504 | stackoverflow | MACHINE_LEARNING | Error when importing to_categorical from tensorflow.keras.utils | Error when importing to_categorical from tensorflow.keras.utils
Whenever I use
from tensorflow.keras.utils import to_categorical
or
from tensorflow.keras.datasets import mnist
I receive the error "could not be resolved". Did anything change over the last years, is the a new way to import them? Thanks!
I can import t... | https://stackoverflow.com/questions/79467504/error-when-importing-to-categorical-from-tensorflow-keras-utils | python, tensorflow, mnist | 1,740,506,944 |
se_79474503 | stackoverflow | MACHINE_LEARNING | Why does my Keras model show 4 parameters instead of 2? | Why does my Keras model show 4 parameters instead of 2?
I'm training a simple Keras model with one Dense layer, but when I call model.summary(), it shows 4 parameters instead of 2.
import tensorflow as tf
import numpy as np
# Generate dummy data
X_train = np.random.rand(40) # Shape (40,)
y_train = np.random.rand(40)... | https://stackoverflow.com/questions/79474503/why-does-my-keras-model-show-4-parameters-instead-of-2 | python, tensorflow, machine-learning, keras, deep-learning | 1,740,716,331 |
se_62164686 | stackoverflow | MACHINE_LEARNING | Keras custom loss function using other arguments than y_pred and y_true | Keras custom loss function using other arguments than y_pred and y_true
I was thinking the idea of using a perceptron-like neural network to solve my problem. I have a dataset that, for the sake of simplicity, looks like this:
id entryWoodLength entryWoodThickness cuttingToolPos1 cuttingToolPos2 exitWoodLength exitWo... | https://stackoverflow.com/questions/62164686/keras-custom-loss-function-using-other-arguments-than-y-pred-and-y-true | python, tensorflow, keras, loss-function | 1,591,154,530 |
se_79473994 | stackoverflow | MACHINE_LEARNING | Loss function for Multi-Label Classification of multiple labels and sparse outcomes | Loss function for Multi-Label Classification of multiple labels and sparse outcomes
Consider the Multi-Label Classification with ANN where the targeted labels were of the form
[0,0,0,0,0,1,0,1,0,0,0,1]
[0,0,0,1,0,0,0,0,0,0,0,0]
...
There were N labels each of True(1) or False(0) represented in a N length vector.
I en... | https://stackoverflow.com/questions/79473994/loss-function-for-multi-label-classification-of-multiple-labels-and-sparse-outco | tensorflow, pytorch, classification, multilabel-classification | 1,740,692,896 |
se_72870081 | stackoverflow | MACHINE_LEARNING | How to add descriptions to keras model and load it from saved model? | How to add descriptions to keras model and load it from saved model?
I train and save CNN keras model as it follows:
callback = EarlyStopping(monitor=monitor, mode='auto', patience=patience)
mc = ModelCheckpoint('Models/CNN.h5', monitor=monitor, verbose=1, save_best_only=True)
history = model.fit(
train_ds,
v... | https://stackoverflow.com/questions/72870081/how-to-add-descriptions-to-keras-model-and-load-it-from-saved-model | tensorflow, keras | 1,657,026,850 |
se_76673142 | stackoverflow | MACHINE_LEARNING | Order of batch, prefetch, shuffle and cache in a Tensorflow dataset | Order of batch, prefetch, shuffle and cache in a Tensorflow dataset
When creating a dataset from a generator, what would be the correct order of the following dataset methods? Or does the order not matter here?
ds = tf.data.Dataset.from_generator(my_generator)
ds = ds.prefetch(tf.data.AUTOTUNE).shuffle(1000).batch(128... | https://stackoverflow.com/questions/76673142/order-of-batch-prefetch-shuffle-and-cache-in-a-tensorflow-dataset | python, tensorflow, keras, tensorflow-datasets | 1,689,183,248 |
se_57832879 | stackoverflow | MACHINE_LEARNING | How to uninstall bazel 0.29.0 in order to install 0.26.1 because of tensorflow | How to uninstall bazel 0.29.0 in order to install 0.26.1 because of tensorflow
I am using Redhat 7.3. I need to install tensorflow for that I already installed bazel 0.29.0 and when I wanted to configure tensorflow it requires bazel 0.26.1. Thats why i tried to uninstall bazel 0.29.0 but was not able to do it. I am ne... | https://stackoverflow.com/questions/57832879/how-to-uninstall-bazel-0-29-0-in-order-to-install-0-26-1-because-of-tensorflow | tensorflow, redhat, bazel | 1,567,852,572 |
se_55290709 | stackoverflow | MACHINE_LEARNING | What does from_logits = True or False mean in sparse_categorical_crossentropy of Tensorflow? | What does from_logits = True or False mean in sparse_categorical_crossentropy of Tensorflow?
In Tensorflow 2.0,
there is a loss function called
tf.keras.losses.sparse_categorical_crossentropy(labels, targets, from_logits = False)
What are the differences between setting from_logits = True or False?
My guess was that ... | https://stackoverflow.com/questions/55290709/what-does-from-logits-true-or-false-mean-in-sparse-categorical-crossentropy-of | tensorflow, machine-learning, loss-function, cross-entropy | 1,553,210,795 |
se_39782245 | stackoverflow | MACHINE_LEARNING | Scaled logits with cross entropy | Scaled logits with cross entropy
In Tensorflow, I have a classifier network and unbalanced training classes. For various reasons I cannot use resampling to compensate for the unbalanced data. Therefore I am forced to compensate for the misbalance by other means, specifically multiplying the logits by weights based on ... | https://stackoverflow.com/questions/39782245/scaled-logits-with-cross-entropy | neural-network, tensorflow, cross-entropy | 1,475,198,071 |
se_77120484 | stackoverflow | MACHINE_LEARNING | Creating Tensors from features that are linked together | Creating Tensors from features that are linked together
I have a set of multi valued features which are linked together. As an example,
ItemCodes
Scores
AK, NA, UY
0.6, 0.2, 0.2
KG, AK
0.5, 0.5
Each Item has a corresponding score associated with it. Some rows might not have any items/scores. I want to co... | https://stackoverflow.com/questions/77120484/creating-tensors-from-features-that-are-linked-together | tensorflow, tensorflow-transform | 1,694,925,219 |
se_78227343 | stackoverflow | MACHINE_LEARNING | Using tft.scale_to_gaussian for preprocessing a dataset without using other tensorflow operations | Using tft.scale_to_gaussian for preprocessing a dataset without using other tensorflow operations
I'm working on a project where I have a set of longtail data that I want to transform into a Gaussian distribution. I'm looking to achieve something similar to scikit-learn's PowerTransformer, but using TensorFlow Transfo... | https://stackoverflow.com/questions/78227343/using-tft-scale-to-gaussian-for-preprocessing-a-dataset-without-using-other-tens | tensorflow, gaussian, data-preprocessing, tensorflow-transform | 1,711,476,049 |
se_79471599 | stackoverflow | MACHINE_LEARNING | YOLOv8 Hand Detection Fails at Close Range After TensorFlow.js Conversion | YOLOv8 Hand Detection Fails at Close Range After TensorFlow.js Conversion
I'm using YOLOv8 for real-time hand detection in a web app. The model works well in Python, but after converting it to TensorFlow.js, detection struggles when the hand is too close to the webcamβsometimes missing it entirely or misplacing the bo... | https://stackoverflow.com/questions/79471599/yolov8-hand-detection-fails-at-close-range-after-tensorflow-js-conversion | javascript, python, tensorflow, tensorflow.js, yolov8 | 1,740,630,592 |
se_44931720 | stackoverflow | MACHINE_LEARNING | ModuleNotFoundError: No module named 'tensorflow'? | ModuleNotFoundError: No module named 'tensorflow'?
I got this error in Jupyter Notebook.
this may duplicate post but no any proper answer found
Neither below links helped me to solve this.
No module named tensorflow in jupyter
No module named tensor flow -- iPython notebook
-------------------------------... | https://stackoverflow.com/questions/44931720/modulenotfounderror-no-module-named-tensorflow | python, python-3.x, tensorflow, jupyter-notebook | 1,499,272,673 |
se_79209650 | stackoverflow | MACHINE_LEARNING | Error: torch.dtype' object has no attribute 'base_dtype | Error: torch.dtype' object has no attribute 'base_dtype
I am trying to train the BERT model but I haven't figured out the structure of TensorFlow yet. In the line for x = self.bert_module(book) an error occurs.
Exception encountered when calling layer 'Embedding-Token' (type TokenEmbedding).
'torch.dtype' obje... | https://stackoverflow.com/questions/79209650/error-torch-dtype-object-has-no-attribute-base-dtype | python, tensorflow, bert-language-model | 1,732,161,897 |
se_79466339 | stackoverflow | MACHINE_LEARNING | MLP with data and physics loss | MLP with data and physics loss
I have the following problem: Training an MLP on 4 inputs while also having an estimation from a physical model (with some error). I now want to compute a combined loss from the physics and data loss and use this for training the MLP (1 output as a regression value). I'm using tensorflow... | https://stackoverflow.com/questions/79466339/mlp-with-data-and-physics-loss | tensorflow, loss-function, mlp | 1,740,481,635 |
se_79146271 | stackoverflow | MACHINE_LEARNING | Importing OpenCV and TensorFlow Lite into ns-3.38 | Importing OpenCV and TensorFlow Lite into ns-3.38
I am currently working on a project that involves using OpenCV and TensorFlow Lite within the ns-3.38 simulation environment. Despite several attempts, I am facing difficulties with configuring and integrating these libraries correctly.
I have tried updating the CMakeL... | https://stackoverflow.com/questions/79146271/importing-opencv-and-tensorflow-lite-into-ns-3-38 | c++, tensorflow, opencv, tensorflow-lite, ns-3 | 1,730,407,343 |
se_79390621 | stackoverflow | MACHINE_LEARNING | Saved tensorflow model makes wrong predictions | Saved tensorflow model makes wrong predictions
I have trained a regression model with tensorflow and I got very good results on my test dataset. I saved this model with model.save(), but when I tried to load it with tf.keras.models.load_model("best_model.keras"), the evaluation started to make wrong predictions and th... | https://stackoverflow.com/questions/79390621/saved-tensorflow-model-makes-wrong-predictions | tensorflow, deep-learning, tensorflow2.0 | 1,737,978,732 |
se_79463660 | stackoverflow | MACHINE_LEARNING | Tensorflow GradientTape Error "inside its context is signficantly less efficient than calling it outside the context"? | Tensorflow GradientTape Error "inside its context is signficantly less efficient than calling it outside the context"?
I am currently working on Adversarial Attacks on Image dataset. The most important libraries in my project are :
Tensorflow 2.10.1 (with CUDA) (the error is with tensorflow)
Pytorch 1.13.1+... | https://stackoverflow.com/questions/79463660/tensorflow-gradienttape-error-inside-its-context-is-signficantly-less-efficient | python, tensorflow, pytorch, gradient | 1,740,403,055 |
se_74139366 | stackoverflow | MACHINE_LEARNING | Argument 'x' passed to 'cast' must be a Tensor or TensorLike, but got 'Tensor' for React Native | Argument 'x' passed to 'cast' must be a Tensor or TensorLike, but got 'Tensor' for React Native
I couldn't find an example called tensorflow/qna on React native and I did it with my own means, but I couldn't get rid of this error.
Argument 'x' passed to 'cast' must be a Tensor or TensorLike, bu... | https://stackoverflow.com/questions/74139366/argument-x-passed-to-cast-must-be-a-tensor-or-tensorlike-but-got-tensor-f | reactjs, react-native, tensorflow, tensorflow.js | 1,666,266,505 |
se_62358745 | stackoverflow | MACHINE_LEARNING | OSError: SavedModel file does not exist at: C:\Users\Munib\New folder/{saved_model.pbtxt|saved_model.pb} | OSError: SavedModel file does not exist at: C:\Users\Munib\New folder/{saved_model.pbtxt|saved_model.pb}
I wanted to use my keras trained model in android studio. I got this code on internet to convert my code from keras to tensorflow-lite. But when i tried code i got this error:
OSError: SavedModel file does not exi... | https://stackoverflow.com/questions/62358745/oserror-savedmodel-file-does-not-exist-at-c-users-munib-new-folder-saved-mod | python, tensorflow, keras, tensorflow-lite | 1,592,045,631 |
se_71261999 | stackoverflow | MACHINE_LEARNING | How to find contours in dotted text captcha image | How to find contours in dotted text captcha image
I am newbie to OpenCV. I'm trying to find the contours of the captcha image. It does not work only when my captcha image contains the dotted text.
I have done following code for that:
import numpy as np
import cv2 as cv
import imgaug.augmenters as iaa
im = cv.imread('... | https://stackoverflow.com/questions/71261999/how-to-find-contours-in-dotted-text-captcha-image | python, tensorflow, opencv, machine-learning, computer-vision | 1,645,771,172 |
se_58115212 | stackoverflow | MACHINE_LEARNING | Using Tensorboard to monitor training real time and visualize the model architecture | Using Tensorboard to monitor training real time and visualize the model architecture
I am learning to use Tensorboard -- Tensorflow 2.0.
In particular, I would like to monitor the learning curves realtime and also to visually inspect and communicate the architecture of my model.
Below I will provide code for a repro... | https://stackoverflow.com/questions/58115212/using-tensorboard-to-monitor-training-real-time-and-visualize-the-model-architec | python-3.x, tensorflow, tensorboard | 1,569,495,143 |
se_48796169 | stackoverflow | MACHINE_LEARNING | How to fix ipykernel_launcher.py: error: unrecognized arguments in jupyter? | How to fix ipykernel_launcher.py: error: unrecognized arguments in jupyter?
I am following this tensorflow tutorial after two days setting up the environment I finally could run premade_estimator.py using cmd
but when I try to run the same code in a jupyter notebook I am getting this error:
usage: ipykernel_launcher... | https://stackoverflow.com/questions/48796169/how-to-fix-ipykernel-launcher-py-error-unrecognized-arguments-in-jupyter | python, python-3.x, tensorflow, jupyter-notebook, jupyter | 1,518,642,226 |
se_58306578 | stackoverflow | MACHINE_LEARNING | Training Chip and Target Image format in TensorFlow | Training Chip and Target Image format in TensorFlow
I am trying to build a Land Cover Classification model for Sentinel Image. The Image Channels(bands) I am using are 32-bit float.
I need to understand how to best format the Image data, both the chips/patches for training and the Target Image for Classification. I ha... | https://stackoverflow.com/questions/58306578/training-chip-and-target-image-format-in-tensorflow | tensorflow, machine-learning, keras, training-data, satellite-image | 1,570,631,706 |
se_79457437 | stackoverflow | MACHINE_LEARNING | numpy eager execution problem after loading a CNN model | numpy eager execution problem after loading a CNN model
I want to save and load a CNN model to further training. I have developed a model and saved it as .h5 file. There is no problem when creating, training, and saving at first run.
The problem exists when loading an existing .h5 model and attempting to train it. The... | https://stackoverflow.com/questions/79457437/numpy-eager-execution-problem-after-loading-a-cnn-model | python, numpy, tensorflow, machine-learning, keras | 1,740,142,854 |
se_79252290 | stackoverflow | MACHINE_LEARNING | Install TensorFlow and Gym with Conda for usage with Jupyter Notebook in macOS Sonoma, Intel processor | Install TensorFlow and Gym with Conda for usage with Jupyter Notebook in macOS Sonoma, Intel processor
I am trying to set up a virtual environment using Conda to code a lab activity regarding RL, but it is proving to be quite a nightmare due to incompatibilities among different library versions. The code will be run l... | https://stackoverflow.com/questions/79252290/install-tensorflow-and-gym-with-conda-for-usage-with-jupyter-notebook-in-macos-s | macos, tensorflow, jupyter-notebook, openai-gym | 1,733,335,545 |
se_56100720 | stackoverflow | MACHINE_LEARNING | name "model" is not defined Keras | name "model" is not defined Keras
I have this error while saving mode:
NameError Traceback (most recent call
last) in ()
----> 1 Model.save(model, filepath="image_ocr/model.h5")
NameError: name 'model' is not defined
//imports:
from keras.models import load_model
from keras... | https://stackoverflow.com/questions/56100720/name-model-is-not-defined-keras | python-3.x, tensorflow, keras | 1,557,674,947 |
se_79456471 | stackoverflow | MACHINE_LEARNING | Python multithreading or multiprocessing or something else | Python multithreading or multiprocessing or something else
So i am in the case where i want to train and predict with few hundred models.
for training it is all fine as tensorflow seem to use all the computing power of the cpu cores.
when predicting i need to load each model from disk and use it. this does not use all... | https://stackoverflow.com/questions/79456471/python-multithreading-or-multiprocessing-or-something-else | multithreading, tensorflow, multiprocessing, gil | 1,740,118,219 |
se_55083018 | stackoverflow | MACHINE_LEARNING | How do you use Ragged Tensors with tf.data and TFRecords? | How do you use Ragged Tensors with tf.data and TFRecords?
Tensorflow recently released Ragged Tensors: https://www.tensorflow.org/guide/ragged_tensors
But there isn't any documentation on how to save ragged data as a TFRecord, and restore it using the data api. | https://stackoverflow.com/questions/55083018/how-do-you-use-ragged-tensors-with-tf-data-and-tfrecords | python, tensorflow, tensorflow-datasets | 1,552,174,119 |
se_79429129 | stackoverflow | MACHINE_LEARNING | Problem in Evaluation of TensorFlow Federated Model | Problem in Evaluation of TensorFlow Federated Model
I am working on eavesdropper detection on B5G system with Deep Learning. The training dataset contains 1200 CSI images of legitimate and malicious UEs.
I have created a DCNN model (with Keras Sequential()) that takes as input the images and used it with Federated Lea... | https://stackoverflow.com/questions/79429129/problem-in-evaluation-of-tensorflow-federated-model | python, tensorflow, google-colaboratory, anomaly-detection, tensorflow-federated | 1,739,257,428 |
se_62031683 | stackoverflow | MACHINE_LEARNING | Ragged tensors as input for LSTM | Ragged tensors as input for LSTM
Learning about ragged tensors and how can I use them with tensorflow.
My example
xx = tf.ragged.constant([
[0.1, 0.2],
[0.4, 0.7 , 0.5, 0.6]
])
yy = np.array([[0, 0, 1], [1,0,0]])
mdl = tf.keras.Sequential([
... | https://stackoverflow.com/questions/62031683/ragged-tensors-as-input-for-lstm | tensorflow, machine-learning, keras | 1,590,528,312 |
se_79451236 | stackoverflow | MACHINE_LEARNING | Tflite Detection Postprocess Explanation | Tflite Detection Postprocess Explanation
I am trying to replicate the working of TFLITE_DETECTION_POSTPROCESS layer for a custom object detection model.
Does anyone has any reference for TFLITE_DETECTION_POSTPROCESS layer implementation in python?
I have this file detection_postprocess as reference from tensorflow rep... | https://stackoverflow.com/questions/79451236/tflite-detection-postprocess-explanation | tensorflow, tensorflow2.0, object-detection, tensorflow-lite, single-shot-detector | 1,739,966,274 |
se_73615934 | stackoverflow | MACHINE_LEARNING | Suppress tensorflow-metal initialization messages | Suppress tensorflow-metal initialization messages
I have a macbook pro m1 max and installed tensorflow via tensowflow-apple-download.
I get the following logs every time I run a script that uses keras or tensorflow:
>>> python script.py
Metal device set to: Apple M1 Max
systemMemory: 32.00 GB
maxCacheSize: 10.67 GB
... | https://stackoverflow.com/questions/73615934/suppress-tensorflow-metal-initialization-messages | python, tensorflow, keras, apple-m1 | 1,662,428,585 |
se_78825554 | stackoverflow | MACHINE_LEARNING | How to install TensorFlow 2.16 on Macbook Pro M2? | How to install TensorFlow 2.16 on Macbook Pro M2?
I currently use TensorFlow 2.13.1 (tensorflow-macos) with TF-metal (1.0.0). I want to migrate to TensorFlow 2.16.1 to keep up with the updates.
In the update website, they say the following:
Apple Silicon
If you previously installed TensorFlow using pip install tensor... | https://stackoverflow.com/questions/78825554/how-to-install-tensorflow-2-16-on-macbook-pro-m2 | python, tensorflow, pip, conda, apple-silicon | 1,722,602,419 |
se_75062860 | stackoverflow | MACHINE_LEARNING | Install Tensorflow in MacOs M1 | Install Tensorflow in MacOs M1
I am struggling to install tensorflow on MacOS Monterey 12.5.1 with M1 Chip
pip3 install tensorflow-macos
pip3 install tensorflow-metal
I keep getting this error: ERROR: Could not find a version that satisfies the requirement python (from versions: none)
I tried venv, I tried miniconda,... | https://stackoverflow.com/questions/75062860/install-tensorflow-in-macos-m1 | python, tensorflow, apple-m1 | 1,673,297,953 |
se_78845096 | stackoverflow | MACHINE_LEARNING | TensorFlow Metal not installable on M2 MacBook and Github page is down | TensorFlow Metal not installable on M2 MacBook and Github page is down
I've been attempting to install tf metal on my computer so that I can use GPUs instead of CPUs. I have tf macOS installed already, and I am fully updated with pip and tf. I'm currently 2 months into building and training a tf CNN, and I'm at the po... | https://stackoverflow.com/questions/78845096/tensorflow-metal-not-installable-on-m2-macbook-and-github-page-is-down | macos, tensorflow, gpu, tensorflow-metal | 1,723,053,243 |
se_79445046 | stackoverflow | MACHINE_LEARNING | TFLite C++ API Invoke causes Segmentation fault | TFLite C++ API Invoke causes Segmentation fault
I am having issues running a simple call to TFLite (C++ API) interpreter. Might be my C++ setup issue, but I honestly have no idea where the problem is.
So within the 'constructor' the model loads and runs a dummy image through it to initialize the weights.
All the conse... | https://stackoverflow.com/questions/79445046/tflite-c-api-invoke-causes-segmentation-fault | c++, tensorflow, tflite | 1,739,786,697 |
se_79439177 | stackoverflow | MACHINE_LEARNING | Why are the outputs from PyTorch and TensorFlow GRU layers not equivalent? | Why are the outputs from PyTorch and TensorFlow GRU layers not equivalent?
I'm trying to port a trained Multi-cell GRU model in TensorFlow 1.x to PyTorch because I want to combine the encoder with some other, more advanced PyTorch modules. I managed to extract the weights to a separate NumPy array per layer. However, ... | https://stackoverflow.com/questions/79439177/why-are-the-outputs-from-pytorch-and-tensorflow-gru-layers-not-equivalent | tensorflow, pytorch, gru | 1,739,531,646 |
se_34770468 | stackoverflow | MACHINE_LEARNING | Running tensorflow on GPU cluster in virtualenv | Running tensorflow on GPU cluster in virtualenv
I installed the GPU version of tensorflow in a virtualenv following these instructions. The problem is, I am getting a segmentation fault upon starting a session. That is, this code:
import tensorflow as tf
sess = tf.InteractiveSession()
exits with the following error... | https://stackoverflow.com/questions/34770468/running-tensorflow-on-gpu-cluster-in-virtualenv | python, installation, tensorflow | 1,452,698,648 |
se_79448077 | stackoverflow | MACHINE_LEARNING | RuntimeError: 'tuple' object has no attribute 'rank'βcustom DenseVariational prior/posterior functions are returning a tuple instead of a tensor | RuntimeError: 'tuple' object has no attribute 'rank'βcustom DenseVariational prior/posterior functions are returning a tuple instead of a tensor
I'm encountering a runtime error when building my Bayesian neural network using tfp.layers.DenseVariational layers on QuantConnect. The error occurs during mo... | https://stackoverflow.com/questions/79448077/runtimeerror-tuple-object-has-no-attribute-rank-custom-densevariational-pri | tensorflow, keras, bayesian, tensorflow-probability | 1,739,877,956 |
se_53416245 | stackoverflow | MACHINE_LEARNING | Best model type in TensorFlow.js for Color Prediction? | Best model type in TensorFlow.js for Color Prediction?
I was creating a color predictor when I realized a problem arise. I got the model to work successfully, but the predictions are always within the same median range of about 2.5 to about 5.5. The model is supposed to output a 0 thru 8 corresponding to each color, a... | https://stackoverflow.com/questions/53416245/best-model-type-in-tensorflow-js-for-color-prediction | javascript, tensorflow, machine-learning, tensorflow.js | 1,542,816,843 |
se_76305972 | stackoverflow | MACHINE_LEARNING | How build face geometry in threeJS from scaledMesh of detected face using tensorflow in js? | How build face geometry in threeJS from scaledMesh of detected face using tensorflow in js?
I want to create Geometry of a detected face in ThreeJS.
I'm using Tensorflow library to detect faces.
but when i use the BufferGeometry to create the Geometry of a detected face, the results are not same as i want.
this is th... | https://stackoverflow.com/questions/76305972/how-build-face-geometry-in-threejs-from-scaledmesh-of-detected-face-using-tensor | javascript, tensorflow, three.js | 1,684,756,917 |
se_78286768 | stackoverflow | MACHINE_LEARNING | Trying to use keras pipeline: Unrecognized keyword arguments passed to Dense: | Trying to use keras pipeline: Unrecognized keyword arguments passed to Dense:
I installed keras-ocr from pip and am running this:
import keras_ocr
I get this error here but I've read I can just ignore it:
2024-04-07 01:32:55.323689: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimiz... | https://stackoverflow.com/questions/78286768/trying-to-use-keras-pipeline-unrecognized-keyword-arguments-passed-to-dense | python, tensorflow, keras | 1,712,468,402 |
se_60670924 | stackoverflow | MACHINE_LEARNING | AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.losses' has no attribute 'softmax_cross_entropy' | AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.losses' has no attribute 'softmax_cross_entropy'
I have an AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.losses' has no attribute 'softmax_cross_entropy' error when using tf.losses.softmax_cross_entropy. Could someo... | https://stackoverflow.com/questions/60670924/attributeerror-module-tensorflow-core-python-keras-api-v2-keras-losses-has-n | python, tensorflow, keras, cross-entropy | 1,584,104,330 |
se_65745874 | stackoverflow | MACHINE_LEARNING | tensorflow GPU is not available | tensorflow GPU is not available
I followed through Jeff Heaton's youtube video to install tensorflow with GPU. I have Eva nivida GTX 1660 Ti. After that, it show GPU is not available. any suggestion if something goes wrong? Thanks
https://www.youtube.com/watch?v=PnK1jO2kXOQ&list=PLrx-l85_irc5IQhZ-yOLq6NjV7GajbT0h&inde... | https://stackoverflow.com/questions/65745874/tensorflow-gpu-is-not-available | python, tensorflow | 1,610,763,477 |
se_79434694 | stackoverflow | MACHINE_LEARNING | Tensorflow not picking up gpu when compatible drivers are installed | Tensorflow not picking up gpu when compatible drivers are installed
nvidia-smi
Thu Feb 13 03:13:38 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.42.06 Driver Version: 555.42.06 CUDA Version: 12.5 |
|-----------------------... | https://stackoverflow.com/questions/79434694/tensorflow-not-picking-up-gpu-when-compatible-drivers-are-installed | python, tensorflow, gpu | 1,739,401,315 |
se_79443941 | stackoverflow | MACHINE_LEARNING | Why does my keras model with multiple inputs accept the shape of the training data for .call() but not for .evaluate()? | Why does my keras model with multiple inputs accept the shape of the training data for .call() but not for .evaluate()?
Im currently investigating the effekt of masking attention Scores on MultiHeadAttention Layers in a Transformer model for classification of time series data. I have build a model that accepts a time ... | https://stackoverflow.com/questions/79443941/why-does-my-keras-model-with-multiple-inputs-accept-the-shape-of-the-training-da | python, tensorflow, keras, transformer-model | 1,739,740,356 |
se_69361779 | stackoverflow | MACHINE_LEARNING | Implementing CTC loss keras | Implementing CTC loss keras
Considering the fact that you have a basic model similar to this:
input_layer = layers.Input(shape=(50,20))
layer = layers.Dense(123, activation = 'relu')
layer = layers.LSTM(128, return_sequences = True)(layer)
outputs = layers.Dense(20, activation='softmax')(layer)
model = Model(input_lay... | https://stackoverflow.com/questions/69361779/implementing-ctc-loss-keras | python, tensorflow, keras, ctc | 1,632,832,151 |
se_70481186 | stackoverflow | MACHINE_LEARNING | Tensorflow error could not find a version that satisfies requirement setup.py | Tensorflow error could not find a version that satisfies requirement setup.py
I am trying to install Tensorflow on Jetson Nano. I have followed this document and have been able to install Tensorflow.
>>> import tensorflow as tf
>>> tf.__version__
>>> '2.5.0'
I am now trying to install object-detection api. For this I... | https://stackoverflow.com/questions/70481186/tensorflow-error-could-not-find-a-version-that-satisfies-requirement-setup-py | python, tensorflow, object-detection-api, nvidia-jetson-nano | 1,640,448,217 |
se_79420818 | stackoverflow | MACHINE_LEARNING | Clearing tf.data.Dataset from GPU memory | Clearing tf.data.Dataset from GPU memory
I'm running into an issue when implementing a training loop that uses a tf.data.Dataset as input to a Keras model. My dataset has an element spec of the following format:
({'data': TensorSpec(shape=(15000, 1), dtype=tf.float32), 'index': TensorSpec(shape=(2,), dtype=tf.int64)},... | https://stackoverflow.com/questions/79420818/clearing-tf-data-dataset-from-gpu-memory | python, tensorflow, machine-learning, keras | 1,738,929,732 |
se_79441303 | stackoverflow | MACHINE_LEARNING | Prediction takes more time than training for roberta model with TPU | Prediction takes more time than training for roberta model with TPU
I am trying to train a roberta model from scratch on a custom data in google colab. I am able to get the training done using TPU and I could see significant reduction in the training time (it take hours in CPU but gets done in couple of minutes with T... | https://stackoverflow.com/questions/79441303/prediction-takes-more-time-than-training-for-roberta-model-with-tpu | tensorflow, deep-learning, google-colaboratory, tpu, roberta | 1,739,613,660 |
se_71742437 | stackoverflow | MACHINE_LEARNING | TensorFlow: Upgrading code with TF1 to TF2 with tf_upgrade_v2 | TensorFlow: Upgrading code with TF1 to TF2 with tf_upgrade_v2
When I try to run tf_upgrade_v2 on a project I get this error message:
"C:\Users\jimin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\tensorflow\tools\compatibility\ast_edits.py", li... | https://stackoverflow.com/questions/71742437/tensorflow-upgrading-code-with-tf1-to-tf2-with-tf-upgrade-v2 | python, windows, tensorflow, tensorflow2.0 | 1,649,098,774 |
se_61740410 | stackoverflow | MACHINE_LEARNING | ml5.js gives: Cannot read property 'shape' of undefined on featureExtractor.regression.train for video (ML5.JS) | ml5.js gives: Cannot read property 'shape' of undefined on featureExtractor.regression.train for video (ML5.JS)
Using javascript I'm trying to use ml5.js version 0.5.0 to detect if I'm beginning, middle or end within a video. Yes I know I can do this other ways but I would like to do this using ML. So for ex... | https://stackoverflow.com/questions/61740410/ml5-js-gives-cannot-read-property-shape-of-undefined-on-featureextractor-regr | javascript, tensorflow, neural-network, html5-video, ml5.js | 1,589,235,641 |
se_78717341 | stackoverflow | MACHINE_LEARNING | Keras training speed with PyTorch backend is a lot slower than with TensorFlow | Keras training speed with PyTorch backend is a lot slower than with TensorFlow
I am on native Windows and I used old Keras with TensorFlow 2.10 (GPU accelerated) before. I wanted to try Keras 3 with PyTorch backend.
Can someone please help me why this model trains 10x slower with Keras 3.4.1 and PyTorch 2.3.1 backend?... | https://stackoverflow.com/questions/78717341/keras-training-speed-with-pytorch-backend-is-a-lot-slower-than-with-tensorflow | python, performance, tensorflow, keras, pytorch | 1,720,356,519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.