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_49794023 | stackoverflow | MACHINE_LEARNING | Use Keras model with Flatten layer inside OpenCV 3 | Use Keras model with Flatten layer inside OpenCV 3
I use Keras with TensorFlow as a backend to create and train a simple CNN.
I am able to save the model and its weights in a .pb file, freeze it and optimize it for inference but when I try to load it into OpenCV 3.4.1 I get the error:
flatten/Shape:Shape(max_pooling2d... | https://stackoverflow.com/questions/49794023/use-keras-model-with-flatten-layer-inside-opencv-3 | python, opencv, tensorflow, deep-learning, keras | 1,523,528,387 |
se_78540428 | stackoverflow | MACHINE_LEARNING | Peft model from checkpoint leading into size missmatch | Peft model from checkpoint leading into size missmatch
I have trained peft model and saved it in huggingface. No i want to merge it with base model.
i have used following code.
from peft import PeftModel, PeftConfig,AutoPeftModelForCausalLM
from transformers import AutoModelForCausalLM,pipeline,AutoTokenizer,BitsAndBy... | https://stackoverflow.com/questions/78540428/peft-model-from-checkpoint-leading-into-size-missmatch | deep-learning, large-language-model, llama, fine-tuning, peft | 1,716,831,304 |
se_79057233 | stackoverflow | MACHINE_LEARNING | How to pass an element from a limited list as input? | How to pass an element from a limited list as input?
I possess a compilation of the different states of arm within the game "rock paper scissors". My intention is to program these categories in a similar manner as this.
[1, 0, 0] - rock
[0, 1, 0] - paper
[0, 0, 1] - scissors
is there a convenient automatic way?
I e... | https://stackoverflow.com/questions/79057233/how-to-pass-an-element-from-a-limited-list-as-input | python, machine-learning, deep-learning, pytorch | 1,728,138,209 |
se_79047727 | stackoverflow | MACHINE_LEARNING | How to implement SwiGLU activation? Why does SwiGLU takes in two tensors? | How to implement SwiGLU activation? Why does SwiGLU takes in two tensors?
The SwiGLU variant introduced in https://arxiv.org/pdf/2002.05202 is simply "divine benevolence" and the implementation on Flash-Attention just works out of the box https://github.com/Dao-AILab/flash-attention/tree/main
Comparing the the impleme... | https://stackoverflow.com/questions/79047727/how-to-implement-swiglu-activation-why-does-swiglu-takes-in-two-tensors | python, deep-learning, pytorch, large-language-model, flash-attn | 1,727,887,149 |
se_68800129 | stackoverflow | MACHINE_LEARNING | libtorch/Pytorch: Slicing channels from Tensor in C++ | libtorch/Pytorch: Slicing channels from Tensor in C++
I have a neural network for a segmentation task which produces an output tensor ofshape [1, 2, 416, 416]. The first index is the batch size, the second is the output channel. I can get rid of the the batch dimension by using squeeze(). I can reduce the two channels... | https://stackoverflow.com/questions/68800129/libtorch-pytorch-slicing-channels-from-tensor-in-c | c++, opencv, deep-learning, pytorch, libtorch | 1,629,105,036 |
se_79048595 | stackoverflow | MACHINE_LEARNING | Convert Yolov4-tiny model weights to tflite | Convert Yolov4-tiny model weights to tflite
I have trained a YoloV4-tiny object detecion model using darknet by referring this tutorial. My images are of size 1024x64.
I got yolov4-tiny_custom_training_last.weights as output.
I want to convert this to tflite. I tried some methods but they are outdated or not supportin... | https://stackoverflow.com/questions/79048595/convert-yolov4-tiny-model-weights-to-tflite | deep-learning, object-detection, darknet, tflite, yolov4 | 1,727,906,825 |
se_64052030 | stackoverflow | MACHINE_LEARNING | Can we Ignore unnecessary classes in the Tensorflow object detection API by only omitting labels in pbtxt label map file? | Can we Ignore unnecessary classes in the Tensorflow object detection API by only omitting labels in pbtxt label map file?
I am trying to create custom datasets for object detection using the Tensorflow Object detection API. When working with open source datasets the annotation files I have come across as PASCAL VOC xm... | https://stackoverflow.com/questions/64052030/can-we-ignore-unnecessary-classes-in-the-tensorflow-object-detection-api-by-only | tensorflow, deep-learning, object-detection | 1,600,970,817 |
se_79033319 | stackoverflow | MACHINE_LEARNING | torch.autograd.grad is returning `None` when calculating derivative wrt time | torch.autograd.grad is returning `None` when calculating derivative wrt time
I have an LSTM model that takes 3 sequences of temperature data and outputs the next sequence.
input => [array([0.20408163, 0.40816327, 0.6122449 ]),
array([0.40816327, 0.6122449 , 0.81632653])]
output=> [tensor(0.81632653, dtype=... | https://stackoverflow.com/questions/79033319/torch-autograd-grad-is-returning-none-when-calculating-derivative-wrt-time | deep-learning, pytorch, neural-network, lstm, physics | 1,727,489,270 |
se_67387321 | stackoverflow | MACHINE_LEARNING | Using Google MLKit in an iOS Framework | Using Google MLKit in an iOS Framework
I have a swift framework and in that framework I am using GoogleMLKit/SegmentationSelfie. Because MLKit is only available via cocoa pods I have had to convert my project to a pods project and I import the MLKit library as follows.
# Uncomment the next line to define a global plat... | https://stackoverflow.com/questions/67387321/using-google-mlkit-in-an-ios-framework | ios, deep-learning, google-mlkit, semantic-segmentation | 1,620,140,663 |
se_68575597 | stackoverflow | MACHINE_LEARNING | MLKit: Remove background from video capture using MLKSegmentationMask | MLKit: Remove background from video capture using MLKSegmentationMask
I am using MLKit for iOS for Selfie Segmentation. In their sample project they are using a coloured mask to identify the background. I need to remove the background using MLKSegmentationMask and from CVImageBufferRef
https://developers.google.com/m... | https://stackoverflow.com/questions/68575597/mlkit-remove-background-from-video-capture-using-mlksegmentationmask | ios, objective-c, deep-learning, google-mlkit, semantic-segmentation | 1,627,560,339 |
se_75122134 | stackoverflow | MACHINE_LEARNING | MediaPipe selfie segmentation: Getting error when trying to capture stream from canvas | MediaPipe selfie segmentation: Getting error when trying to capture stream from canvas
I'm trying to use selfie segmentation on the image from my webcam. For this, I'm using the MediaPipe lib.
Here is my code
const selfieSegmentation = new SelfieSegmentation({locateFile: (file) => {
return `https://cdn.jsdelivr.ne... | https://stackoverflow.com/questions/75122134/mediapipe-selfie-segmentation-getting-error-when-trying-to-capture-stream-from | javascript, deep-learning, mediapipe, semantic-segmentation | 1,673,741,476 |
se_77497124 | stackoverflow | MACHINE_LEARNING | Gogole MLKit model takes longer than expected to process | Gogole MLKit model takes longer than expected to process
I want to use Google MLKit Android SDK for segmentation, and following its official tutorial I made this simple code using latest API version (com.google.mlkit:segmentation-selfie:16.0.0-beta4). I'm running on a Samsung S10+ which has a good GPU and the official... | https://stackoverflow.com/questions/77497124/gogole-mlkit-model-takes-longer-than-expected-to-process | java, android, deep-learning, google-mlkit, semantic-segmentation | 1,700,158,227 |
se_77490008 | stackoverflow | MACHINE_LEARNING | cannot import name 'TypeAliasType' from 'typing_extensions' (/usr/local/lib/python3.10/dist-packages/typing_extensions.py) | cannot import name 'TypeAliasType' from 'typing_extensions' (/usr/local/lib/python3.10/dist-packages/typing_extensions.py)
I using elevenlab api for voice cloning in google colab. Here is my code
import elevenlabs
from elevenlabs import set_api_key
set_api_key("*****************")
It gives me this e... | https://stackoverflow.com/questions/77490008/cannot-import-name-typealiastype-from-typing-extensions-usr-local-lib-pyth | python, machine-learning, deep-learning, nlp, google-colaboratory | 1,700,071,714 |
se_61060736 | stackoverflow | MACHINE_LEARNING | How to interpret model.summary() output in CNN? | How to interpret model.summary() output in CNN?
I am new to deep learning and CNNs. If a CNN has been created as shown in the screenshot, then how can one explain the outputs as described by model.summary(). I am not able to understand the output shapes of different layers.
Model summary:
Model: "sequential_3"
____... | https://stackoverflow.com/questions/61060736/how-to-interpret-model-summary-output-in-cnn | tensorflow, keras, deep-learning, google-colaboratory, conv-neural-network | 1,586,179,030 |
se_79041593 | stackoverflow | MACHINE_LEARNING | Which way to use KL divergence in PyTorch is correct? And what if zero is in distribution? | Which way to use KL divergence in PyTorch is correct? And what if zero is in distribution?
I am trying to fit distribution p to distribution q with KL divergence.
import torch
p = torch.Tensor([0.1, 0.2, 0.7])
q = torch.Tensor([0.333, 0.334, 0.333])
So I calculate kl divergence by myself:
def kl_div(P, Q):
retur... | https://stackoverflow.com/questions/79041593/which-way-to-use-kl-divergence-in-pytorch-is-correct-and-what-if-zero-is-in-dis | deep-learning, pytorch | 1,727,754,937 |
se_59609404 | stackoverflow | MACHINE_LEARNING | Relu not works, sigmoid works fine | Relu not works, sigmoid works fine
I am confused with one phenomenon when I use sigmoid in output layer,the network works fine. But the network does not converge if I set the activation of output as Relu.the training loss would not reduce, after the first epoch. Could anybody explain this phenomenon.
The input of ne... | https://stackoverflow.com/questions/59609404/relu-not-works-sigmoid-works-fine | deep-learning, mobilenet | 1,578,302,172 |
se_79019507 | stackoverflow | MACHINE_LEARNING | The accuracy in the neural network does not change | The accuracy in the neural network does not change
The code of a fully connected NN (I know what is better convolutional, I will do it further), which determines the numbers from the MNIST dataset. When enabled, accuracy does not change at all. What could be the mistake? I have divided the code cells with lines, and m... | https://stackoverflow.com/questions/79019507/the-accuracy-in-the-neural-network-does-not-change | python, deep-learning, pytorch, neural-network | 1,727,194,641 |
se_43364985 | stackoverflow | MACHINE_LEARNING | How to stop gradient for some entry of a tensor in tensorflow | How to stop gradient for some entry of a tensor in tensorflow
I am trying to implement an embedding layer. The embedding is going to be initialized using pre-trained glove embedding. For words that can be found in glove, it will be fixed. For those words that don't appear in glove, it will be initialized randomly, and... | https://stackoverflow.com/questions/43364985/how-to-stop-gradient-for-some-entry-of-a-tensor-in-tensorflow | tensorflow, deep-learning | 1,491,987,755 |
se_78540526 | stackoverflow | MACHINE_LEARNING | Mask R-CNN: How to infer the shape of Lambda's output? | Mask R-CNN: How to infer the shape of Lambda's output?
I am exploring the following sample code of Mask R-CNN:
https://github.com/matterport/Mask_RCNN/tree/master/samples
However, when I ran the demo.ipynb file, an error was returned for the code below, which I don't know how to fix.
model = modellib.MaskRCNN(mode... | https://stackoverflow.com/questions/78540526/mask-r-cnn-how-to-infer-the-shape-of-lambdas-output | python, tensorflow, keras, deep-learning, mask-rcnn | 1,716,832,962 |
se_77781734 | stackoverflow | MACHINE_LEARNING | Sagemaker batch transformer with my own pre-trained model | Sagemaker batch transformer with my own pre-trained model
I'm trying to run inference on demand for yolo-nas using sagemaker batch transformer.
Using pre trained model with pre trained weights.
But I am getting this error:
python3: can't open file '//serve': [Errno 2] No such file or directory
I have no idea what th... | https://stackoverflow.com/questions/77781734/sagemaker-batch-transformer-with-my-own-pre-trained-model | python, machine-learning, deep-learning, amazon-sagemaker, mlops | 1,704,729,258 |
se_75164008 | stackoverflow | MACHINE_LEARNING | Evaluating DQN, Vehicle Routing Problem (VRP) | Evaluating DQN, Vehicle Routing Problem (VRP)
I am running this DQN algorithm that is trying to minimize the total distance traveled by a vehicle (VRP).
In the training, as you can see in the images, everything works fine. The loss is decreasing, the average length in decreasing, and the reward is increasing.
However,... | https://stackoverflow.com/questions/75164008/evaluating-dqn-vehicle-routing-problem-vrp | deep-learning, pytorch, training-data, vehicle-routing, dqn | 1,674,068,045 |
se_58394649 | stackoverflow | MACHINE_LEARNING | How to use nature inspired algorithms like PSO as optimizers in keras model? | How to use nature inspired algorithms like PSO as optimizers in keras model?
I am working on a keras model (Hierarchical attention network) to classify text into various categories. I have currently used Adam optimizer. I wish to use nature inspired algorithms like PSO, Cuckoo etc. as optimizers.
The relevant code i... | https://stackoverflow.com/questions/58394649/how-to-use-nature-inspired-algorithms-like-pso-as-optimizers-in-keras-model | keras, deep-learning, particle-swarm | 1,571,142,304 |
se_79033026 | stackoverflow | MACHINE_LEARNING | Do steps round down when it's fractional? | Do steps round down when it's fractional?
I have begun experimenting with training machine learning models and encountered some confusion around the concepts of epochs and steps in the training process. While researching online, I came across a formula (𝜎 = (𝜀 × 𝜂) ÷ 𝛽) relating epochs, steps, and batch size. ... | https://stackoverflow.com/questions/79033026/do-steps-round-down-when-its-fractional | tensorflow, machine-learning, deep-learning | 1,727,474,639 |
se_60005715 | stackoverflow | MACHINE_LEARNING | How to pass input dim from fit method to skorch wrapper? | How to pass input dim from fit method to skorch wrapper?
I am trying to incorporate PyTorch functionalities into a scikit-learn environment (in particular Pipelines and GridSearchCV) and therefore have been looking into skorch. The standard documentation example for neural networks looks like
import torch.nn.function... | https://stackoverflow.com/questions/60005715/how-to-pass-input-dim-from-fit-method-to-skorch-wrapper | python, deep-learning, pytorch, skorch | 1,580,480,520 |
se_79028171 | stackoverflow | MACHINE_LEARNING | Does the pytorch model support parallelism? | Does the pytorch model support parallelism?
Is it possible to deploy a pytorch model using fastapi to support multiple concurrency?
Or is it not possible to support concurrency because pytorch models operate synchronously?
If fastapi can't support it directly, what would it take to support it?
To know if it's possible... | https://stackoverflow.com/questions/79028171/does-the-pytorch-model-support-parallelism | deep-learning, pytorch, concurrency, model, fastapi | 1,727,366,434 |
se_79027142 | stackoverflow | MACHINE_LEARNING | Exploding Gradient (NaN Training Loss And Validation Loss) In Multi Head Self Attention - Vision Transformer | Exploding Gradient (NaN Training Loss And Validation Loss) In Multi Head Self Attention - Vision Transformer
This multihead self attention code causes the training loss and validation loss to become NaN, but when I remove this part, everything goes back to normal. I know that when the training loss and validation loss... | https://stackoverflow.com/questions/79027142/exploding-gradient-nan-training-loss-and-validation-loss-in-multi-head-self-at | machine-learning, deep-learning, pytorch, transformer-model, vision-transformer | 1,727,351,295 |
se_79015581 | stackoverflow | MACHINE_LEARNING | Fatal error in OpenCV function readNetFromONNX() | Fatal error in OpenCV function readNetFromONNX()
I have a working application that performs detection using ssd_mobilenet_v2, powered solely by OpenCV 4.6.0. My system is Ubuntu 24, C++17, CLion. I want to switch to v3, using ONNX format, but I experience fatal errors when trying to load the model:
Before load
[ERROR:... | https://stackoverflow.com/questions/79015581/fatal-error-in-opencv-function-readnetfromonnx | c++, opencv, deep-learning, neural-network, computer-vision | 1,727,110,258 |
se_43237124 | stackoverflow | MACHINE_LEARNING | What is the role of "Flatten" in Keras? | What is the role of "Flatten" in Keras?
I am trying to understand the role of the Flatten function in Keras. Below is my code, which is a simple two-layer network. It takes in 2-dimensional data of shape (3, 2), and outputs 1-dimensional data of shape (1, 4):
model = Sequential()
model.add(Dense(16, input_s... | https://stackoverflow.com/questions/43237124/what-is-the-role-of-flatten-in-keras | machine-learning, tensorflow, neural-network, deep-learning, keras | 1,491,410,904 |
se_78601256 | stackoverflow | MACHINE_LEARNING | How to quantize a pretrained model (e.g. MobileNet) | How to quantize a pretrained model (e.g. MobileNet)
I am using tensorflow lite framework in order to create a quantized model for an experiment. I want to deploy this model on my Raspberry Pi but it seems that using a pretrained model for quantizing doesn't work.
I tried executing below code on Colab and Kaggle notebo... | https://stackoverflow.com/questions/78601256/how-to-quantize-a-pretrained-model-e-g-mobilenet | tensorflow, deep-learning, neural-network, google-colaboratory, quantization-aware-training | 1,718,008,532 |
se_57723302 | stackoverflow | MACHINE_LEARNING | Classifying whether a given image is an anomaly/novelty/outlier | Classifying whether a given image is an anomaly/novelty/outlier
I have only "Positive" class image data from an experiment and the task is to train them using a deep learning network. Anything which is slightly different from the above category should be classified as an anomaly/outlier? [Taking negative class data f... | https://stackoverflow.com/questions/57723302/classifying-whether-a-given-image-is-an-anomaly-novelty-outlier | keras, deep-learning, conv-neural-network, autoencoder, anomaly-detection | 1,567,154,132 |
se_68177675 | stackoverflow | MACHINE_LEARNING | Why does my train loss jump down when a new epoch starts? | Why does my train loss jump down when a new epoch starts?
When I train a neural network consisting of 2 convolutional and 2 fully connected layers on the MNIST handwritten digits task, I receive the following train loss curve:
The datasets contains 235 batches and I plotted the loss after each batch for 1500 batches ... | https://stackoverflow.com/questions/68177675/why-does-my-train-loss-jump-down-when-a-new-epoch-starts | deep-learning, pytorch, classification, loss | 1,624,965,497 |
se_78985137 | stackoverflow | MACHINE_LEARNING | Alternative to device_map = "auto" in Huggingface Pretrained | Alternative to device_map = "auto" in Huggingface Pretrained
I have a model that I was reading from huggingface using the following code:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path... | https://stackoverflow.com/questions/78985137/alternative-to-device-map-auto-in-huggingface-pretrained | machine-learning, deep-learning, nlp, huggingface-transformers | 1,726,317,723 |
se_78976316 | stackoverflow | MACHINE_LEARNING | Model Can't Predict Correctly Even Though Has A Good Classification Report | Model Can't Predict Correctly Even Though Has A Good Classification Report
I have tried to run this model from the link:
https://www.kaggle.com/code/alexfordna/garbage-classification-mobilenetv2-92-accuracy/notebook
When I did it on colab with similar dataset (but smaller, 2100 img to 6 classes), it works well. Bu... | https://stackoverflow.com/questions/78976316/model-cant-predict-correctly-even-though-has-a-good-classification-report | tensorflow, machine-learning, deep-learning, conv-neural-network, google-colaboratory | 1,726,109,920 |
se_74996908 | stackoverflow | MACHINE_LEARNING | can't change embedding dimension to pass it through gpt2 | can't change embedding dimension to pass it through gpt2
I'm practicing image captioning and have some problems with different dimensions of tensors. So I have image embedding aka size [1, 512], but GPT2, which I use for caption generation, needs size [n, 768], where n is number of tokens of the caption's beginnin... | https://stackoverflow.com/questions/74996908/cant-change-embedding-dimension-to-pass-it-through-gpt2 | machine-learning, deep-learning, embedding, gpt-2, multimodal | 1,672,768,256 |
se_78995266 | stackoverflow | MACHINE_LEARNING | h2o predict error: Test/Validation dataset has no columns in common with the training set | h2o predict error: Test/Validation dataset has no columns in common with the training set
I'm attempting to implement the deeplearning function in the h2o package and obtain a persistent error despite (seemingly) following the example given in the documentation for the package:
https://www.rdocumentation.org/packages/... | https://stackoverflow.com/questions/78995266/h2o-predict-error-test-validation-dataset-has-no-columns-in-common-with-the-tra | r, deep-learning, h2o | 1,726,595,720 |
se_78993181 | stackoverflow | MACHINE_LEARNING | Empty Columns in Confusion matrix | Empty Columns in Confusion matrix
I am training on pre-processed APTOS 2019 dataset for disease grading and the last two columns of my confusion matrix are constantly zero every time. Data is distributed as:
class 0: 1805 images
class 1: 370 images
class 3: 999 images
class 4: 193 images
class 5: 295 images
Here are... | https://stackoverflow.com/questions/78993181/empty-columns-in-confusion-matrix | machine-learning, deep-learning, pytorch, statistics, confusion-matrix | 1,726,561,901 |
se_54166908 | stackoverflow | MACHINE_LEARNING | Uniformity of color and texture in image | Uniformity of color and texture in image
I am new to the field of deep learning and have a problem in determining whether two images have uniform color and texture. For example, I have a
Master image -
Now, with respect to this image i need to determine whether the following images have uniform texture and color ... | https://stackoverflow.com/questions/54166908/uniformity-of-color-and-texture-in-image | python, opencv, machine-learning, deep-learning, computer-vision | 1,547,364,649 |
se_78991901 | stackoverflow | MACHINE_LEARNING | tried changing the output of vae model to satisfy loss function but something doesnt work | tried changing the output of vae model to satisfy loss function but something doesnt work
I tried to create a VAE model which generally contains a custom loss for which GradientTape() or a class is used for implementation. I didn't want to use these methods and instead tried a workaround which isn't working as expecte... | https://stackoverflow.com/questions/78991901/tried-changing-the-output-of-vae-model-to-satisfy-loss-function-but-something-do | python, tensorflow, machine-learning, deep-learning, neural-network | 1,726,522,779 |
se_78989634 | stackoverflow | MACHINE_LEARNING | gradient becomes none after apply mask on trainable variable | gradient becomes none after apply mask on trainable variable
When I implement the following code, gradient of x becomes none after apply mask on trainable variable. After removed the mask the gradient is able to be calculated. I am wondering what the reason of it.
layer = tf.keras.layers.Dense(2, activation='relu')
x ... | https://stackoverflow.com/questions/78989634/gradient-becomes-none-after-apply-mask-on-trainable-variable | tensorflow, keras, deep-learning, neural-network, gradient | 1,726,480,093 |
se_58587057 | stackoverflow | MACHINE_LEARNING | Multi dimensional inputs in pytorch Linear method? | Multi dimensional inputs in pytorch Linear method?
When building a simple perceptron neural network we usuall passes a 2D matrix of input of format (batch_size,features) to a 2D weight matrix, similar to this simple neural network in numpy. I always assumed a Perceptron/Dense/Linear layer of a neural network only acce... | https://stackoverflow.com/questions/58587057/multi-dimensional-inputs-in-pytorch-linear-method | neural-network, deep-learning, pytorch, perceptron | 1,572,247,733 |
se_77259232 | stackoverflow | MACHINE_LEARNING | How to test nlu model on multiple requests per second? | How to test nlu model on multiple requests per second?
I am testing nlu model called LaBSE. I want to know how much gpu memory is required when i run it. Here is example how to run it on sentence and turn it into embeddings:
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentenc... | https://stackoverflow.com/questions/77259232/how-to-test-nlu-model-on-multiple-requests-per-second | python, python-3.x, deep-learning, transformer-model, sentence-transformers | 1,696,858,187 |
se_78089650 | stackoverflow | MACHINE_LEARNING | Tensorflow keras error AttributeError: 'tuple' object has no attribute 'lower' | Tensorflow keras error AttributeError: 'tuple' object has no attribute 'lower'
I have code:
import tensorflow as tf
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.models import Sequential
from tensorflow.... | https://stackoverflow.com/questions/78089650/tensorflow-keras-error-attributeerror-tuple-object-has-no-attribute-lower | python, python-3.x, tensorflow, keras, deep-learning | 1,709,316,114 |
se_78984183 | stackoverflow | MACHINE_LEARNING | Simple Gradient Descent in Python vs Keras | Simple Gradient Descent in Python vs Keras
I am practicing neural networks by building my own in notebooks. I am trying to check my model against an equivalent model in Keras. My model seems to work the same as other simple coded neural network frameworks, such as this one: https://towardsdatascience.com/coding-neural... | https://stackoverflow.com/questions/78984183/simple-gradient-descent-in-python-vs-keras | tensorflow, keras, deep-learning, gradient-descent | 1,726,282,635 |
se_78979876 | stackoverflow | MACHINE_LEARNING | How to properly prune a YOLO detection model | How to properly prune a YOLO detection model
I am trying to prune a Yolov8 detection model, using this snippet. But when I load the pruned model, it still shows the same number of parameters (3,011,048 parameters). I'm not sure if I'm doing this in the right way.
My question is, is my pruning process correct? And once... | https://stackoverflow.com/questions/78979876/how-to-properly-prune-a-yolo-detection-model | deep-learning, conv-neural-network, object-detection, yolov8, pruning | 1,726,173,846 |
se_78964885 | stackoverflow | MACHINE_LEARNING | I need to write complex-value neural network in tensorflow but I get an error | I need to write complex-value neural network in tensorflow but I get an error
I have complex input to into the neural network, and I also need the neural network to have complex weights, but when writing the code, I get the error as below:
---------------------------------------------------------------------------
Va... | https://stackoverflow.com/questions/78964885/i-need-to-write-complex-value-neural-network-in-tensorflow-but-i-get-an-error | tensorflow, deep-learning, neural-network | 1,725,875,418 |
se_37179332 | stackoverflow | MACHINE_LEARNING | Error in keras - name 'Dense' is not defined | Error in keras - name 'Dense' is not defined
I've installed Theano & keras in my windows system by following these steps (I already had anaconda):
Install TDM GCC x64.
Run the below code from command prompt
conda update conda
conda update --all
conda install mingw libpython
pip install git+git://github.com/The... | https://stackoverflow.com/questions/37179332/error-in-keras-name-dense-is-not-defined | python-2.7, deep-learning, keras | 1,463,035,971 |
se_66094139 | stackoverflow | MACHINE_LEARNING | Issue setting up SciKeras model | Issue setting up SciKeras model
I have an existing setup using scikit-learn, but am looking into expanding into deep learning with Keras. I am also using Dask, which recommends using SciKeras.
The way the SciKeras KerasClassifier is currently setup, seems to fit as expected (from the verbose output), but the model see... | https://stackoverflow.com/questions/66094139/issue-setting-up-scikeras-model | python, machine-learning, keras, scikit-learn, deep-learning | 1,612,739,996 |
se_53997000 | stackoverflow | MACHINE_LEARNING | purpose of 'num_samples' in Tune of Ray package for hyperprameter optimization | purpose of 'num_samples' in Tune of Ray package for hyperprameter optimization
I am trying to perform a hyper parameter optimization task for a LSTM (pure Tensorflow) with Tune. I followed their example on the hyperopt algorithm. In the example they have used the below line inside the 'config' section.
"n... | https://stackoverflow.com/questions/53997000/purpose-of-num-samples-in-tune-of-ray-package-for-hyperprameter-optimization | python-3.x, tensorflow, deep-learning, hyperparameters, ray | 1,546,359,512 |
se_78970159 | stackoverflow | MACHINE_LEARNING | High Accuracy in PyTorch Handwritten Letter Model Fails During Web App Integration with React and FastAPI, Predicting Only 'r' or 'q' Consistently | High Accuracy in PyTorch Handwritten Letter Model Fails During Web App Integration with React and FastAPI, Predicting Only 'r' or 'q' Consistently
I have developed a simple web application of handwritten english letters recognition, I have used pytorch for building the model which had a really high acc... | https://stackoverflow.com/questions/78970159/high-accuracy-in-pytorch-handwritten-letter-model-fails-during-web-app-integrati | reactjs, deep-learning, deployment, pytorch, handwriting-recognition | 1,725,981,084 |
se_70144331 | stackoverflow | MACHINE_LEARNING | TypeError: Expected float32, but got auto of type 'str'. Tensorflow error , tell me how to fix it? | TypeError: Expected float32, but got auto of type 'str'. Tensorflow error , tell me how to fix it?
I got TypeError: Expected float32, but got auto of type 'str'. error while fitting the sequential model.
I checked my inputs both are numpy.ndarray.
type(xtrain),type(ytrain)
(numpy.ndarray, numpy.ndarray)
model... | https://stackoverflow.com/questions/70144331/typeerror-expected-float32-but-got-auto-of-type-str-tensorflow-error-tell | python, tensorflow, deep-learning, typeerror, tensorflow2.0 | 1,638,109,626 |
se_66526604 | stackoverflow | MACHINE_LEARNING | Keras multioutput custom loss with intermediate layers output | Keras multioutput custom loss with intermediate layers output
I have a model in keras which takes two inputs and it returns 3 outputs and I want to compute a custom loss. The problem I have is that I don't know how to use the output of intermediate layers in the loss. So far the model consisted of two submodels (submo... | https://stackoverflow.com/questions/66526604/keras-multioutput-custom-loss-with-intermediate-layers-output | python, tensorflow, machine-learning, keras, deep-learning | 1,615,192,760 |
se_78164439 | stackoverflow | MACHINE_LEARNING | SOLVE:OSError: libsox.so: cannot open shared object file: No such file or directory (to creat HuBERT) | SOLVE:OSError: libsox.so: cannot open shared object file: No such file or directory (to creat HuBERT)
I have a problem with my program to creat HuBERT model in google colab.
Here is the URL which is HuBERT nanual for githab.
text
There is the problem in first step.
I will develop kmeans program.
I made a TSV file.
Her... | https://stackoverflow.com/questions/78164439/solve-oserror-libsox-so-cannot-open-shared-object-file-no-such-file-or-direct | python, deep-learning, sound-recognition | 1,710,471,435 |
se_37452073 | stackoverflow | MACHINE_LEARNING | Facial Expression Recognition Data Preparation for CNN | Facial Expression Recognition Data Preparation for CNN
I'm doing research on facial expression recognition via Deep Learning specifically CNN. I have some questions with regard to preparing and/or preprocessing my data.
I have segmented videos of frontal facial expressions (e.g. 2-3 seconds video of a person expressin... | https://stackoverflow.com/questions/37452073/facial-expression-recognition-data-preparation-for-cnn | machine-learning, deep-learning, computer-vision, face-recognition | 1,464,239,483 |
se_78964380 | stackoverflow | MACHINE_LEARNING | Is epoch necessary while using A2C algorithm? | Is epoch necessary while using A2C algorithm?
I don't know if this was answered before or not, bear with me please.
For an energy grid control problem, I am using the advantage actor-critic (A2C) algorithm for decision making.
I implemented it as follows:
For each RL episode:
score and memory are cleared/re-initialize... | https://stackoverflow.com/questions/78964380/is-epoch-necessary-while-using-a2c-algorithm | python, deep-learning, reinforcement-learning, actor-critics | 1,725,867,715 |
se_71441720 | stackoverflow | MACHINE_LEARNING | ModuleNotFoundError: No module named 'onnxruntime' | ModuleNotFoundError: No module named 'onnxruntime'
I'm taking a Microsoft PyTorch course and trying to implement on Kaggle Notebooks but I kept having the same error message over and over again: "ModuleNotFoundError: No module named 'onnxruntime'". I've checked everywhere possible if I could find a solution to... | https://stackoverflow.com/questions/71441720/modulenotfounderror-no-module-named-onnxruntime | python, python-3.x, deep-learning, neural-network, kaggle | 1,647,016,454 |
se_78917847 | stackoverflow | MACHINE_LEARNING | TypeError: 'DataLoader' object is not subscriptable in SuperGradients Trainer | TypeError: 'DataLoader' object is not subscriptable in SuperGradients Trainer
I've created DataLoader objects for my training and validation datasets, but when I try to pass them to the trainer.train() method, I get the following error:
Log summary:
TypeError: 'DataLoader' object is not subscriptable
Full log... | https://stackoverflow.com/questions/78917847/typeerror-dataloader-object-is-not-subscriptable-in-supergradients-trainer | python, machine-learning, deep-learning, pytorch, dataloader | 1,724,747,318 |
se_61900138 | stackoverflow | MACHINE_LEARNING | PyTorch "Caught IndexError in DataLoader worker process 0", "IndexError: too many indices for array" | PyTorch "Caught IndexError in DataLoader worker process 0", "IndexError: too many indices for array"
I am trying to implement a detection model based on "finetuning object detection" official tutorial of PyTorch.
It seemed to have worked with minimal data, (for 10 of images). However I uploaded my... | https://stackoverflow.com/questions/61900138/pytorch-caught-indexerror-in-dataloader-worker-process-0-indexerror-too-man | python, machine-learning, deep-learning, pytorch | 1,589,919,906 |
se_78885552 | stackoverflow | MACHINE_LEARNING | How to fix 'script returned exit code 15' when running Jenkins pipeline | How to fix 'script returned exit code 15' when running Jenkins pipeline
I am defining a pipeline using Jenkins. I am working on a text summarizer project and using jenkins for CICD. After triggering the pipeline,in CD stage I am getting error as below:
ssh -o StrictHostKeyChecking=no -l ubuntu 3.226.221.21 'cd... | https://stackoverflow.com/questions/78885552/how-to-fix-script-returned-exit-code-15-when-running-jenkins-pipeline | python, machine-learning, jenkins, deep-learning, jenkins-pipeline | 1,724,011,388 |
se_78448485 | stackoverflow | MACHINE_LEARNING | How to use YOLOv8 to train a model? | How to use YOLOv8 to train a model?
How to set the threshold when yolo trains the model, so that the verification error is less than the same threshold to stop training,
I flipped through Yolo's official documentation and couldn't find the relevant parameters | https://stackoverflow.com/questions/78448485/how-to-use-yolov8-to-train-a-model | python, deep-learning, yolov8, ultralytics | 1,715,170,939 |
se_48799502 | stackoverflow | MACHINE_LEARNING | Size mismatch error during VGG finetuning | Size mismatch error during VGG finetuning
I have been following the ants and bees transfer learning tutorial from the official PyTorch Docs (http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html). I am trying to finetune a VGG19 model by changing the final layer to predict one of two classes. I am able... | https://stackoverflow.com/questions/48799502/size-mismatch-error-during-vgg-finetuning | python, deep-learning, pytorch, vgg-net | 1,518,664,948 |
se_78949615 | stackoverflow | MACHINE_LEARNING | How can the dimensions of a Conv2D layer be calculated? | How can the dimensions of a Conv2D layer be calculated?
I'm trying to understand the dimensions of the output of the Generator of my GAN. The dims of the result after each layer is as follows:
Start: torch.Size([128, 74, 1, 1])
After block1: torch.Size([128, 256, 3, 3])
After block2: torch.Size([128, 128, 6, 6]) ... | https://stackoverflow.com/questions/78949615/how-can-the-dimensions-of-a-conv2d-layer-be-calculated | machine-learning, deep-learning, pytorch, conv-neural-network, generative-adversarial-network | 1,725,466,198 |
se_53164733 | stackoverflow | MACHINE_LEARNING | Difference between Conv3d vs Conv2d | Difference between Conv3d vs Conv2d
I am a little confused with the difference between conv2d and conv3d functions.
For example, if I have a stack of N images with H height and W width, and 3 RGB channels. The input to the network can be two forms
form1: (batch_size, N, H, W, 3) this is a rank 5 tensor
form2: (batch_... | https://stackoverflow.com/questions/53164733/difference-between-conv3d-vs-conv2d | python, tensorflow, neural-network, deep-learning, convolution | 1,541,469,097 |
se_78948998 | stackoverflow | MACHINE_LEARNING | Would it be possible to infer the Merlyn-education-corpus-qa model on two RTX 4090 GPUs? | Would it be possible to infer the Merlyn-education-corpus-qa model on two RTX 4090 GPUs?
I am trying to run the Merlyn-education-corpus-qa model on my two RTX 4090 graphics cards. The code I am using is exactly the same as the one on the HuggingFace page for the model (https://huggingface.co/MerlynMind/merlyn-educatio... | https://stackoverflow.com/questions/78948998/would-it-be-possible-to-infer-the-merlyn-education-corpus-qa-model-on-two-rtx-40 | python, deep-learning, pytorch, huggingface-transformers, sentence-transformers | 1,725,457,505 |
se_68345125 | stackoverflow | MACHINE_LEARNING | How to concatenate a tensor to a keras layer along batch (without specifying batch size)? | How to concatenate a tensor to a keras layer along batch (without specifying batch size)?
I want to concatenate the output from an embedding layer with a custom tensor (myarr / myconst). I can specify everything with a fixed batch size like follows:
import numpy as np
import tensorflow as tf
BATCH_SIZE = 100
myarr = ... | https://stackoverflow.com/questions/68345125/how-to-concatenate-a-tensor-to-a-keras-layer-along-batch-without-specifying-bat | python, tensorflow, machine-learning, keras, deep-learning | 1,626,082,809 |
se_42703500 | stackoverflow | MACHINE_LEARNING | How do I save a trained model in PyTorch? | How do I save a trained model in PyTorch?
How do I save a trained model in PyTorch? I have read that:
torch.save()/torch.load() is for saving/loading a serializable object.
model.state_dict()/model.load_state_dict() is for saving/loading model state. | https://stackoverflow.com/questions/42703500/how-do-i-save-a-trained-model-in-pytorch | python, serialization, deep-learning, pytorch, tensor | 1,489,086,400 |
se_72166348 | stackoverflow | MACHINE_LEARNING | How to set right strides in MLMultiArray in Core ML? What's the strides' values' meaning? | How to set right strides in MLMultiArray in Core ML? What's the strides' values' meaning?
How to set right strides in MLMultiArray in Core ML? What's the EVERY strides' values' meaning?
For example, assume a Core ML model input shape is (1, 3, 1280, 720), so how to set strides when create MLMultiArray obje... | https://stackoverflow.com/questions/72166348/how-to-set-right-strides-in-mlmultiarray-in-core-ml-whats-the-strides-values | ios, machine-learning, deep-learning, coreml, stride | 1,652,062,073 |
se_78842184 | stackoverflow | MACHINE_LEARNING | Text Image Binary Classifier without deep learning or tesseract | Text Image Binary Classifier without deep learning or tesseract
I have 20k small label images and each image has the word "Back" or "Front".
Image resolution is all (200px, 25px)
I can classify these images 100% accuracy with tesseract_OCR.
txt = pytesseract.image_to_string(img, lang='eng')
if "Front"... | https://stackoverflow.com/questions/78842184/text-image-binary-classifier-without-deep-learning-or-tesseract | machine-learning, image-processing, deep-learning, computer-vision, ocr | 1,723,013,196 |
se_78940389 | stackoverflow | MACHINE_LEARNING | Instant accuracy increase while dice increasing slowly (U-Net) | Instant accuracy increase while dice increasing slowly (U-Net)
I am training a model for brain extraction on MR images. I use 2D U-Net architecture and pretrained EfficientNetV2B3.
def dice_coefficients(y_true, y_pred, smooth=0):
intersection = K.sum(y_true * y_pred)
union = K.sum(y_true) + K.sum(y_pred)
... | https://stackoverflow.com/questions/78940389/instant-accuracy-increase-while-dice-increasing-slowly-u-net | python, deep-learning, conv-neural-network, unet-neural-network, efficientnet | 1,725,279,075 |
se_78937759 | stackoverflow | MACHINE_LEARNING | Pytorch `DataSet.__getitem__()` called with `index` bigger than `__len__()` | Pytorch `DataSet.__getitem__()` called with `index` bigger than `__len__()`
I have following torch dataset (I have replaced actual code to read data from files with random number generation to make it minimal reproducible):
from torch.utils.data import Dataset
import torch
class TempDataset(Dataset):
def __init_... | https://stackoverflow.com/questions/78937759/pytorch-dataset-getitem-called-with-index-bigger-than-len | python, python-3.x, machine-learning, deep-learning, pytorch | 1,725,205,938 |
se_59269140 | stackoverflow | MACHINE_LEARNING | How to remove the adaptive average pool layer from vgg19? | How to remove the adaptive average pool layer from vgg19?
I have loaded the pre-trained model of vgg19. How to remove the adaptive average pool layer which is present before the classifier? | https://stackoverflow.com/questions/59269140/how-to-remove-the-adaptive-average-pool-layer-from-vgg19 | machine-learning, deep-learning, pytorch, neural-network, vgg-net | 1,575,987,012 |
se_61934272 | stackoverflow | MACHINE_LEARNING | ValueError: ('Unrecognized keyword arguments:', dict_keys(['ragged'])) | ValueError: ('Unrecognized keyword arguments:', dict_keys(['ragged']))
I trained a cell segmentation model on google colab, one with tensorflow version 1.x, and the other on 2.x. I downloaded this model and am now trying to load it and predict a preselected image I downloaded. Training and building the... | https://stackoverflow.com/questions/61934272/valueerror-unrecognized-keyword-arguments-dict-keysragged | python, tensorflow, machine-learning, keras, deep-learning | 1,590,063,158 |
se_47377222 | stackoverflow | MACHINE_LEARNING | What is the problem with my implementation of the cross-entropy function? | What is the problem with my implementation of the cross-entropy function?
I am learning the neural network and I want to write a function cross_entropy in python. Where it is defined as:
where N is the number of samples, k is the number of classes, log is the natural logarithm, t_i,j is 1 if sample i is in class j an... | https://stackoverflow.com/questions/47377222/what-is-the-problem-with-my-implementation-of-the-cross-entropy-function | python, machine-learning, deep-learning, neural-network, cross-entropy | 1,511,096,932 |
se_49390842 | stackoverflow | MACHINE_LEARNING | `CrossEntropyLoss()` in PyTorch | `CrossEntropyLoss()` in PyTorch
Cross entropy formula:
But why does the following give loss = 0.7437 instead of loss = 0 (since 1*log(1) = 0)?
import torch
import torch.nn as nn
from torch.autograd import Variable
output = Variable(torch.FloatTensor([0,0,0,1])).view(1, -1)
target = Variable(torch.LongTensor([3]))
... | https://stackoverflow.com/questions/49390842/crossentropyloss-in-pytorch | python, machine-learning, deep-learning, pytorch, loss | 1,521,567,584 |
se_70524543 | stackoverflow | MACHINE_LEARNING | InvalidArgumentError: Incompatible shapes: [40,5] vs. [40,4] | InvalidArgumentError: Incompatible shapes: [40,5] vs. [40,4]
I am building a object detection model with bounding boxes and after I build it successfully, I would like to merge it with the vgg16 classifier.
I have googled the error. But I still cannot debug it.
I know that the 40 is my batch_size, and 5 is my number o... | https://stackoverflow.com/questions/70524543/invalidargumenterror-incompatible-shapes-40-5-vs-40-4 | python, machine-learning, deep-learning, classification, object-detection | 1,640,808,874 |
se_53405934 | stackoverflow | MACHINE_LEARNING | How to print the "actual" learning rate in Adadelta in pytorch | How to print the "actual" learning rate in Adadelta in pytorch
In short:
I can't draw lr/epoch curve when using adadelta optimizer in pytorch because optimizer.param_groups[0]['lr'] always return the same value.
In detail:
Adadelta can dynamically adapts over time using only first order information and
h... | https://stackoverflow.com/questions/53405934/how-to-print-the-actual-learning-rate-in-adadelta-in-pytorch | python, optimization, neural-network, deep-learning, pytorch | 1,542,779,255 |
se_53706452 | stackoverflow | MACHINE_LEARNING | How to slice Torch images as numpy images | How to slice Torch images as numpy images
I am working on a problem in which I have the coordinates to slice the image like
X cordinate, Y coordinate, Height, width of the region to crop
So if if I have torch image obtained using
img = Variable(img.cuda())
how can we slice this image to get that specific ar... | https://stackoverflow.com/questions/53706452/how-to-slice-torch-images-as-numpy-images | python, numpy, deep-learning, pytorch | 1,544,447,637 |
se_37483671 | stackoverflow | MACHINE_LEARNING | Convolutional Neural Net always ouputs one class | Convolutional Neural Net always ouputs one class
I'm trying to finetune the imagenet-vgg-f net in matlab using the matconvnet package. Instead of 1000 classes it shall only be able to classify two.
If I only change the very last layer from 1000 to 2 output neurons everything work's out well. If I, however, add one (o... | https://stackoverflow.com/questions/37483671/convolutional-neural-net-always-ouputs-one-class | matlab, machine-learning, deep-learning, neural-network, backpropagation | 1,464,352,281 |
se_63734506 | stackoverflow | MACHINE_LEARNING | The GPU memory is not enough when computing feature centers using pytorch | The GPU memory is not enough when computing feature centers using pytorch
I want use the class feature centers in the loss function when using pytorch. But when I compute the centers, the GPU memory is not enough. How can I solve it? The code is as follows:
for epoch in range((args.start_epoch+1), args.epochs):
Cent... | https://stackoverflow.com/questions/63734506/the-gpu-memory-is-not-enough-when-computing-feature-centers-using-pytorch | machine-learning, deep-learning, pytorch, gpu, out-of-memory | 1,599,190,669 |
se_75902400 | stackoverflow | MACHINE_LEARNING | What can be the cause of poor performance of my neural network on testing data, but a very high accuracy on the training data? | What can be the cause of poor performance of my neural network on testing data, but a very high accuracy on the training data?
I've made an attempt at developing a simple model to tackle a multi-classification problem. I've found a dataset on Kaggle of 25k+ tweets labeled with sentiment of the text (positive, neutral,... | https://stackoverflow.com/questions/75902400/what-can-be-the-cause-of-poor-performance-of-my-neural-network-on-testing-data | python, tensorflow, machine-learning, keras, deep-learning | 1,680,293,340 |
se_71399847 | stackoverflow | MACHINE_LEARNING | RuntimeError: 0D or 1D target tensor expected, multi-target not supported I was training a deep learning model but I am getting this issue | RuntimeError: 0D or 1D target tensor expected, multi-target not supported I was training a deep learning model but I am getting this issue
*My Training Model*
def train(model,criterion,optimizer,iters):
epoch = iters
train_loss = []
validaion_loss = []
train_acc = []
validation_acc = []
states ... | https://stackoverflow.com/questions/71399847/runtimeerror-0d-or-1d-target-tensor-expected-multi-target-not-supported-i-was | python, deep-learning, pytorch, conv-neural-network, cross-entropy | 1,646,763,933 |
se_78915784 | stackoverflow | MACHINE_LEARNING | How to use SegFormer encoder and decoder separately? | How to use SegFormer encoder and decoder separately?
I am trying to understand SegFormer model, and would like to use encoder and decoder separately with different models.
I have tried looking into official implementation which is based on mmseg and also checked transformers based HuggingFace usage, but I don't unders... | https://stackoverflow.com/questions/78915784/how-to-use-segformer-encoder-and-decoder-separately | deep-learning, huggingface-transformers, transformer-model, semantic-segmentation | 1,724,695,408 |
se_73167346 | stackoverflow | MACHINE_LEARNING | How much VRAM do I need for training a Keras model | How much VRAM do I need for training a Keras model
Hello I recently started my bachelor Project in which I need to train a LSTM model which has following structure
inputs (InputLayer) [(None, None, 80)] 0
masking (Masking) (None, None, 80) 0
lstm (LSTM) (None, None, 10... | https://stackoverflow.com/questions/73167346/how-much-vram-do-i-need-for-training-a-keras-model | tensorflow, keras, deep-learning | 1,659,100,460 |
se_52446789 | stackoverflow | MACHINE_LEARNING | Why is ReLU a non-linear activation function? | Why is ReLU a non-linear activation function?
As I understand it, in a deep neural network, we use an activation function (g) after applying the weights (w) and bias(b) (z := w * X + b | a := g(z)). So there is a composition function of (g o z) and the activation function makes so our model can learn function other t... | https://stackoverflow.com/questions/52446789/why-is-relu-a-non-linear-activation-function | machine-learning, neural-network, deep-learning, activation-function, relu | 1,537,543,220 |
se_78327204 | stackoverflow | MACHINE_LEARNING | Changing the input layout of an ONNX model from NCHW to NHWC | Changing the input layout of an ONNX model from NCHW to NHWC
I have an ONNX model with an input shape of (1, 1, 28, 28), which is in an NCHW layout.
Is there any way that I can convert the model to take input data in the NHWC layout, i.e., as (1, 28, 28, 1)?
The model is loaded from a file using the following code: mo... | https://stackoverflow.com/questions/78327204/changing-the-input-layout-of-an-onnx-model-from-nchw-to-nhwc | python, deep-learning, onnx, onnxruntime | 1,713,171,366 |
se_50349176 | stackoverflow | MACHINE_LEARNING | When does ReLU kill the neurons? | When does ReLU kill the neurons?
I am confused regarding the dying ReLU problem. ReLU will kill the neuron only during forward pass? Or also during backward pass? | https://stackoverflow.com/questions/50349176/when-does-relu-kill-the-neurons | machine-learning, deep-learning, activation-function, relu | 1,526,384,106 |
se_78917116 | stackoverflow | MACHINE_LEARNING | PyTorch loss.backward() Error: TypeError: 'NoneType' object is not callable | PyTorch loss.backward() Error: TypeError: 'NoneType' object is not callable
I encountered an error while training a Siamese network using PyTorch. When I call loss.backward() after calculating the loss, I receive a type error. Below are the error messages and the relevant code.
Error Message
Traceback (most re... | https://stackoverflow.com/questions/78917116/pytorch-loss-backward-error-typeerror-nonetype-object-is-not-callable | python, deep-learning, pytorch, loss-function, backpropagation | 1,724,732,763 |
se_78926677 | stackoverflow | MACHINE_LEARNING | How to create graph for higher order derivative in Tensorflow | How to create graph for higher order derivative in Tensorflow
My target is to forcing gradients to be statistically indistinguishable across tasks in a multi-task model by exposing them into a discriminator (inspired by Adversarial Learning, training weights to make it indistinguishable in the discriminator). But I en... | https://stackoverflow.com/questions/78926677/how-to-create-graph-for-higher-order-derivative-in-tensorflow | tensorflow, deep-learning, pytorch, classification, tensorflow2.0 | 1,724,917,458 |
se_19646123 | stackoverflow | MACHINE_LEARNING | Supervised learning(document classification) using deep learning techniques | Supervised learning(document classification) using deep learning techniques
I was reading the papers on deep learning. Most of them refer to unsupervised learning.
They also say the neurons are pre-trained using unsupervised RBM network. Later they are fine tuned using Back propagation algorithm (supervised).
So ca... | https://stackoverflow.com/questions/19646123/supervised-learningdocument-classification-using-deep-learning-techniques | machine-learning, neural-network, deep-learning, supervised-learning | 1,382,998,749 |
se_78924274 | stackoverflow | MACHINE_LEARNING | Get the output of an intermediate layer in Keras for GradCAM for a subclassed model | Get the output of an intermediate layer in Keras for GradCAM for a subclassed model
I am trying to get the output of an intermediate layer for a resnet-style model that I developed using Keras and TensorFlow. My model consists of nested keras.Model objects. For clarity, I am adding the code for my model below:
Model c... | https://stackoverflow.com/questions/78924274/get-the-output-of-an-intermediate-layer-in-keras-for-gradcam-for-a-subclassed-mo | python, tensorflow, keras, deep-learning, gradcam | 1,724,860,946 |
se_78825697 | stackoverflow | MACHINE_LEARNING | MaskRCNN in pytorch gives different loss everytime | MaskRCNN in pytorch gives different loss everytime
I am doing instance segmentation using maskrcnn_resnet50_fpn_v2. I have only class in the training dataset but each image can have up 1000 instances of the single class.
I am running all my codes on kaggle notebook.
I set seed using this function
def seed_everything(s... | https://stackoverflow.com/questions/78825697/maskrcnn-in-pytorch-gives-different-loss-everytime | deep-learning, pytorch, instance-segmentation | 1,722,604,645 |
se_58498651 | stackoverflow | MACHINE_LEARNING | What is FLOPS in field of deep learning? | What is FLOPS in field of deep learning?
What is FLOPS in field of deep learning? Why we don't use the term just FLO?
We use the term FLOPS to measure the number of operations of a frozen deep learning network.
Following Wikipedia, FLOPS = floating point operations per second. When we test computing units, we should... | https://stackoverflow.com/questions/58498651/what-is-flops-in-field-of-deep-learning | performance, deep-learning, flops | 1,571,727,434 |
se_78916012 | stackoverflow | MACHINE_LEARNING | Layer expects 2 input(s), but it received 1 input tensors | Layer expects 2 input(s), but it received 1 input tensors
I am trying to build model to predict posts likes, the model takes text and content type which is one hot encoded column.
I have made a TensorFlow dataset but when trying to fit the model I got this error:
Layer "functional_13" expects 2 input(s), but it receiv... | https://stackoverflow.com/questions/78916012/layer-expects-2-inputs-but-it-received-1-input-tensors | python, tensorflow, machine-learning, deep-learning, nlp | 1,724,700,262 |
se_78914899 | stackoverflow | MACHINE_LEARNING | the data augmentation doesn't work properly | the data augmentation doesn't work properly
according to me, the given code should create 5700 images, which is 10 times the number of original images, instead, when I check the shape of it, it only gives 1140, which is twice the number of images. What am I missing in this code?
# Custom augmentation functions
def... | https://stackoverflow.com/questions/78914899/the-data-augmentation-doesnt-work-properly | python, deep-learning, data-science, data-augmentation, image-augmentation | 1,724,681,658 |
se_78753201 | stackoverflow | MACHINE_LEARNING | LSTM Model doesn't train | LSTM Model doesn't train
I am trying to find the chemical state of a particle with deep learning. As inputs I have the position of the particle according to time in X_train with shape (num_train,sequence_length). (My sequence length is 100), the ouput is the frame of transition (between 1 and 100) contained in Y_t... | https://stackoverflow.com/questions/78753201/lstm-model-doesnt-train | python, machine-learning, keras, deep-learning, lstm | 1,721,115,100 |
se_78865593 | stackoverflow | MACHINE_LEARNING | How to train a model using a text dataset | How to train a model using a text dataset
I want to create an AI model that generates text. Specifically, BDD Gherkin cucumber scenarios and step definitions based of input of a user story.
User story with BDD Gherkin cucumber example
For example.
User story (Input): I want to add products to my shopping basket on an ... | https://stackoverflow.com/questions/78865593/how-to-train-a-model-using-a-text-dataset | machine-learning, deep-learning, large-language-model, unsupervised-learning, text-generation | 1,723,543,143 |
se_58422023 | stackoverflow | MACHINE_LEARNING | Trying to Install AWS CLI on my Mac OS (Catalina) | Trying to Install AWS CLI on my Mac OS (Catalina)
ERROR:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/PyYAML-5.1.2.dist-info'
Consider using the `--user` option or check the permissions.
This is the message I keep getting from my terminal..... | https://stackoverflow.com/questions/58422023/trying-to-install-aws-cli-on-my-mac-os-catalina | python, macos, amazon-web-services, deep-learning, macos-catalina | 1,571,261,939 |
se_64593792 | stackoverflow | MACHINE_LEARNING | How to make Intel GPU available for processing through pytorch? | How to make Intel GPU available for processing through pytorch?
I'm using a laptop which has Intel Corporation HD Graphics 520.
Does anyone know how to it set up for Deep Learning, specifically Pytorch? I have seen if you have Nvidia graphics I can install cuda but what to do when you have intel GPU? | https://stackoverflow.com/questions/64593792/how-to-make-intel-gpu-available-for-processing-through-pytorch | deep-learning, pytorch, gpu, intel | 1,603,983,780 |
se_62715811 | stackoverflow | MACHINE_LEARNING | Does tf.math.reduce_max allows gradient flow like torch.max? | Does tf.math.reduce_max allows gradient flow like torch.max?
I am trying to build a multi-label binary classification model in Tensorflow. The model has a tf.math.reduce_max operator between two layers (It is not Max Pooling, it's for a different purpose).
And the number of classes is 3.
I am using Binary Cross Entrop... | https://stackoverflow.com/questions/62715811/does-tf-math-reduce-max-allows-gradient-flow-like-torch-max | tensorflow, deep-learning, pytorch | 1,593,780,609 |
se_38293441 | stackoverflow | MACHINE_LEARNING | Will doing image cropping excessively lead to poor performance of deep learning model? | Will doing image cropping excessively lead to poor performance of deep learning model?
I am building a deep learning model to recognize images. From what I have read, data augmentation such as random cropping of images will lead to less overfitting of the model. However, I am not sure if doing it excessively will lead... | https://stackoverflow.com/questions/38293441/will-doing-image-cropping-excessively-lead-to-poor-performance-of-deep-learning | crop, deep-learning | 1,468,164,252 |
se_62838589 | stackoverflow | MACHINE_LEARNING | Keras model not predicting values in the Test set | Keras model not predicting values in the Test set
I'm building a Keras model to predict predict if the user will select the certain product or not (binary classification).
Model seems to be making progress on Validation set that is heldout while training, but the model's predictions are all 0s when it comes to the tes... | https://stackoverflow.com/questions/62838589/keras-model-not-predicting-values-in-the-test-set | machine-learning, keras, deep-learning, neural-network, recommendation-engine | 1,594,398,615 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.