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_79574117 | stackoverflow | MACHINE_LEARNING | SGLang server fails on launch due to cuda_fp8.h missing even with --disable-cuda-graph and prebuilt flashinfer wheel | SGLang server fails on launch due to cuda_fp8.h missing even with --disable-cuda-graph and prebuilt flashinfer wheel
I am trying to launch the SGLang server using python -m sglang.launch_server ... but it consistently fails during the "Capture cuda graph" phase. The error indicates a failure during Just-In-Time (JIT) ... | https://stackoverflow.com/questions/79574117/sglang-server-fails-on-launch-due-to-cuda-fp8-h-missing-even-with-disable-cuda | machine-learning, deep-learning, pytorch, sglang | 1,744,670,379 |
se_73450382 | stackoverflow | MACHINE_LEARNING | Keras Functional replace intermediate layers | Keras Functional replace intermediate layers
I would like to replace BatchNorm layers with GroupNorm in built-in keras models, e.g. ResNet50.
I'm trying to reset nodes' layers to my new layer, however nothing changes when I query a model.summary().
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflo... | https://stackoverflow.com/questions/73450382/keras-functional-replace-intermediate-layers | python, tensorflow, keras, deep-learning, neural-network | 1,661,198,114 |
se_52774120 | stackoverflow | MACHINE_LEARNING | Why Batch-normalization Layer follows scale layer in caffe? | Why Batch-normalization Layer follows scale layer in caffe?
I noticed that Batch Normalization layer follows Scale layer in mobile net. It seems BN layer and scale layer are a pair.
And Convolution layer + BN layer + Scale layer + ReLU layer works well.
So what scale layer do?
It seems caffe can't learn parameters in... | https://stackoverflow.com/questions/52774120/why-batch-normalization-layer-follows-scale-layer-in-caffe | deep-learning, caffe, batch-normalization | 1,539,328,075 |
se_44782505 | stackoverflow | MACHINE_LEARNING | Batch Normalization makes Training Faster? | Batch Normalization makes Training Faster?
I read everywhere that, in addition to improving performances regarding accuracy, "Batch Normalization makes Training Faster".
I probably misunderstand something (cause BN has been proven efficient more than once) but it seems king of unlogical to me.
Indeed, adding BN to a n... | https://stackoverflow.com/questions/44782505/batch-normalization-makes-training-faster | deep-learning, batch-normalization | 1,498,572,625 |
se_47815058 | stackoverflow | MACHINE_LEARNING | Batch normalization and small mini-batch | Batch normalization and small mini-batch
I am not completely familiar with batch normalization layers,. As I understand it, it is going to compute normalization at training time using mini-batch statistics.
Do any of you have experience using thesen layers when the minibatch size is very small (for example using 2 or... | https://stackoverflow.com/questions/47815058/batch-normalization-and-small-mini-batch | deep-learning, conv-neural-network | 1,513,259,735 |
se_38553927 | stackoverflow | MACHINE_LEARNING | Batch Normalization in Convolutional Neural Network | Batch Normalization in Convolutional Neural Network
I would like to know some details on applying batch normalisation in CNN.
I read this paper https://arxiv.org/pdf/1502.03167v3.pdf and could understand the BN algorithm applied on a data but in the end they mentioned that a slight modification is required when applie... | https://stackoverflow.com/questions/38553927/batch-normalization-in-convolutional-neural-network | machine-learning, computer-vision, deep-learning, conv-neural-network, batch-normalization | 1,469,375,698 |
se_79561611 | stackoverflow | MACHINE_LEARNING | Q-values output is NaN in DQN model - input state is normalized and padded | Q-values output is NaN in DQN model - input state is normalized and padded
I'm training a Deep Q-Network (DQN) to trade crypto using historical data. My model keeps outputting NaN values for the Q-values during prediction. I'm using a custom function getState2() to generate the state, and the state is then passed into... | https://stackoverflow.com/questions/79561611/q-values-output-is-nan-in-dqn-model-input-state-is-normalized-and-padded | python, tensorflow, keras, deep-learning | 1,744,103,185 |
se_79561884 | stackoverflow | MACHINE_LEARNING | How to perform global structured pruning in PyTorch | How to perform global structured pruning in PyTorch
I am training on CIFAR10 the following simple CNN
class SimpleCNN(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 32, kernel_size=3, padding=1)
self.conv2 = nn.Conv2d(32, 64, kernel_size=3, padding=1)
s... | https://stackoverflow.com/questions/79561884/how-to-perform-global-structured-pruning-in-pytorch | python, machine-learning, deep-learning, pytorch, pruning | 1,744,111,216 |
se_38303974 | stackoverflow | MACHINE_LEARNING | tensorflow running error with cublas | tensorflow running error with cublas
when I successfully install tensorflow on cluster, I immediately running mnist demo to check if it's going well, but here I came up with a problem. I don't know what is this all about, but it looks like the error is coming from CUDA
python3 -m tensorflow.models.image.mnist.convolu... | https://stackoverflow.com/questions/38303974/tensorflow-running-error-with-cublas | gpu, tensorflow, deep-learning, cublas | 1,468,230,812 |
se_44387105 | stackoverflow | MACHINE_LEARNING | Deep Neural Networks vs. Big Data Analytics | Deep Neural Networks vs. Big Data Analytics
I'm a prospective PhD (CS) student. I've worked in the area of Anomaly Detection during my MS Research. Now, I've got two major and recently emerging areas to choose, i.e., Deep Neural Networks and Big Data Analytics. However, I've to chose one as my future area to work on. ... | https://stackoverflow.com/questions/44387105/deep-neural-networks-vs-big-data-analytics | neural-network, deep-learning, anomaly-detection, bigdata | 1,496,743,605 |
se_79546777 | stackoverflow | MACHINE_LEARNING | Saving and Loading Images for Tensorflow Lite | Saving and Loading Images for Tensorflow Lite
Planning on using Tensorflow Lite for image classification.
To test the model, using Fashion-MNIST database to create the model following a Tensorflow basic example from their website. Created and saved the model and want to test it in TF Lite.
I want to save an image from... | https://stackoverflow.com/questions/79546777/saving-and-loading-images-for-tensorflow-lite | python, tensorflow, deep-learning, python-imaging-library, tensorflow-lite | 1,743,438,821 |
se_79553429 | stackoverflow | MACHINE_LEARNING | Yolov11 training gives torch.OutOfMemoryError | Yolov11 training gives torch.OutOfMemoryError
I am trying to train a yolov11 model for a set of images but I am running into an issue. The GPU the model is training on is a GeForce RTX 4070 super.
I am using yolov11 with torch with GPU.
print(torch.__version__)
2.5.1+cu121
I did train the model a few times before wit... | https://stackoverflow.com/questions/79553429/yolov11-training-gives-torch-outofmemoryerror | python, machine-learning, deep-learning, yolo | 1,743,695,674 |
se_79555794 | stackoverflow | MACHINE_LEARNING | Issues with Tensorflow and Tensorflow-io while training a CNN on Colab | Issues with Tensorflow and Tensorflow-io while training a CNN on Colab
I have been training some CNNs on Colab by Tensorflow and Tensorflow-io since January. The training of a model lasted more or less 30 mins till a couple of months ago. Now, since some weeks ago, after the importing of the latest versions of Tf and ... | https://stackoverflow.com/questions/79555794/issues-with-tensorflow-and-tensorflow-io-while-training-a-cnn-on-colab | python, tensorflow, deep-learning, google-colaboratory, tensorflow-io | 1,743,781,938 |
se_75709831 | stackoverflow | MACHINE_LEARNING | Zero Accuracy in Sentiment Analysis FFNN Model (Pytorch) | Zero Accuracy in Sentiment Analysis FFNN Model (Pytorch)
I'm constructing a feedforward neural net (FFNN) for binary sentiment classification using movie review dataset. It's a simplified task with only two class labels, i.e., positive (1) and negative (0). It FFNN makes word embeddings, averages them, runs them throu... | https://stackoverflow.com/questions/75709831/zero-accuracy-in-sentiment-analysis-ffnn-model-pytorch | python, deep-learning, pytorch, nlp, sentiment-analysis | 1,678,572,297 |
se_79512576 | stackoverflow | MACHINE_LEARNING | Pytorch nn model not learning anymore after going through the first dataset batch | Pytorch nn model not learning anymore after going through the first dataset batch
I've written a code which goes through different datasets grouped in labels and lets the created model learn each dataset/label separately.
The problem now is that the model learns the first dataset perfectly well, but after that only le... | https://stackoverflow.com/questions/79512576/pytorch-nn-model-not-learning-anymore-after-going-through-the-first-dataset-batc | deep-learning, pytorch | 1,742,129,852 |
se_44716150 | stackoverflow | MACHINE_LEARNING | How can I assign a class_weight in Keras in a simple way? | How can I assign a class_weight in Keras in a simple way?
Can anyone tell me what is the simplest way to apply class_weight in Keras when the dataset is unbalanced please?
I only have two classes in my target.
Thanks. | https://stackoverflow.com/questions/44716150/how-can-i-assign-a-class-weight-in-keras-in-a-simple-way | python, tensorflow, deep-learning, keras | 1,498,204,948 |
se_62111599 | stackoverflow | MACHINE_LEARNING | Load data into GPU directly using PyTorch | Load data into GPU directly using PyTorch
In training loop, I load a batch of data into CPU and then transfer it to GPU:
import torch.utils as utils
train_loader = utils.data.DataLoader(train_dataset, batch_size=128, shuffle=True, num_workers=4, pin_memory=True)
for inputs, labels in train_loader:
inputs, label... | https://stackoverflow.com/questions/62111599/load-data-into-gpu-directly-using-pytorch | python-3.x, deep-learning, pytorch, gpu, dataloader | 1,590,899,452 |
se_59868132 | stackoverflow | MACHINE_LEARNING | What does backbone mean in a neural network? | What does backbone mean in a neural network?
I am getting confused with the meaning of "backbone" in neural networks, especially in the DeepLabv3+ paper. I did some research and found out that backbone could mean
the feature extraction part of a network
DeepLabv3+ took Xception and ResNet-101 as its backbone. Howeve... | https://stackoverflow.com/questions/59868132/what-does-backbone-mean-in-a-neural-network | deep-learning, neural-network, deeplab | 1,579,726,634 |
se_76248184 | stackoverflow | MACHINE_LEARNING | Keras tuning that prefers faster models? | Keras tuning that prefers faster models?
I'm trying to tune hyperparameters to get a sense of what values are best in tensorflow keras models. I'm going to use the best model in a minimax algorithm, so speed of evaluation is important due to the amount of estimations for the algorithm. Also, the speed of tuning is mad... | https://stackoverflow.com/questions/76248184/keras-tuning-that-prefers-faster-models | python, tensorflow, machine-learning, keras, deep-learning | 1,684,076,869 |
se_65621414 | stackoverflow | MACHINE_LEARNING | How to merge two torch.utils.data dataloaders with a single operation | How to merge two torch.utils.data dataloaders with a single operation
I have two dataloaders and I would like to merge them without redefining the datasets, in my case train_dataset and val_dataset.
train_loader = DataLoader(train_dataset, batch_size = 512, drop_last=True,shuffle=True)
val_loader = DataLoader(val_data... | https://stackoverflow.com/questions/65621414/how-to-merge-two-torch-utils-data-dataloaders-with-a-single-operation | deep-learning, pytorch, dataloader | 1,610,062,185 |
se_41442687 | stackoverflow | MACHINE_LEARNING | Does make sense use dynamic learning rate in AdamOptimizer? | Does make sense use dynamic learning rate in AdamOptimizer?
I'm dvelopping a convolutional neural network for images recognition based on three own classes.
I built an AlexNet-based model to train.
I'd like to know two things:
AdamOptimizer performs a learning rate decay internally (from a fixed given value) or not ... | https://stackoverflow.com/questions/41442687/does-make-sense-use-dynamic-learning-rate-in-adamoptimizer | tensorflow, deep-learning | 1,483,443,580 |
se_56892614 | stackoverflow | MACHINE_LEARNING | Formal meaning of 'weight-tying' expression in literature | Formal meaning of 'weight-tying' expression in literature
I recently came across the term Weight-tying regarding auto-encoders and words-embeddings as well - yet couldn't find a clear definition.
My guess is that it means concatenating multiple outputs of ,say, FC layers and feeding to a single layer, thus '... | https://stackoverflow.com/questions/56892614/formal-meaning-of-weight-tying-expression-in-literature | deep-learning, autoencoder, word-embedding | 1,562,263,296 |
se_47299624 | stackoverflow | MACHINE_LEARNING | How to understand loss, acc, val_loss, val_acc in Keras model fitting? | How to understand loss, acc, val_loss, val_acc in Keras model fitting?
Here are my Keras model results (train on 4160 samples, validate on 1040 samples):
Epoch 1/20
4160/4160 - loss: 3.3455 - acc: 0.1560 - val_loss: 1.6047 - val_acc: 0.4721
Epoch 2/20
4160/4160 - loss: 1.7639 - acc: 0.4274 - val_loss: 0.7060 - val_ac... | https://stackoverflow.com/questions/47299624/how-to-understand-loss-acc-val-loss-val-acc-in-keras-model-fitting | tensorflow, machine-learning, keras, deep-learning | 1,510,721,765 |
se_75011871 | stackoverflow | MACHINE_LEARNING | How to do padding in pandas | How to do padding in pandas
I have a dataset contain of URLs. and after URLs I have related information. I'm going to use deeplearning algorithm to train and test the model. I have an issue of length. Now I want to calculate which has a lot of data and then after that if the data is less than that amount pad it with 0... | https://stackoverflow.com/questions/75011871/how-to-do-padding-in-pandas | python, pandas, keras, deep-learning | 1,672,870,111 |
se_72094542 | stackoverflow | MACHINE_LEARNING | ran into TensorFlow ValueError during my TensorFlow Course with Udemy | ran into TensorFlow ValueError during my TensorFlow Course with Udemy
I have being trying to fit the error during my Tensorflow course (Section 3: Neural network Regression with Tensorflow) with Udemy.
import tensorflow as tf
import numpy as np
X = np.array([-8.0, -5.0, -2.0, 1.0, 4.0, 7.0, 10.0, 13.0])
y = np.array(... | https://stackoverflow.com/questions/72094542/ran-into-tensorflow-valueerror-during-my-tensorflow-course-with-udemy | tensorflow, keras, deep-learning, neural-network | 1,651,548,349 |
se_70348160 | stackoverflow | MACHINE_LEARNING | Tensor Operation and gradient | Tensor Operation and gradient
I was going some tutorials on youtube where below code sample was used to explain derivatives
Create tensors.
x = torch.tensor(3.)
w = torch.tensor(4., requires_grad=True)
b = torch.tensor(5., requires_grad=True)
x, w, b
Arithmetic operations
y = w * x + b
y
... | https://stackoverflow.com/questions/70348160/tensor-operation-and-gradient | deep-learning, pytorch, gradient, tensor, derivative | 1,639,481,520 |
se_79536891 | stackoverflow | MACHINE_LEARNING | Using zip() on two nn.ModuleList | Using zip() on two nn.ModuleList
Is using two different nn.ModuleList() zipped lists correct to build the computational graph for training a neural net in PyTorch? nn.ModuleList is a wrapper around Python's list with a registration of a module for training.
I'm building a network which consists of 2x interchanging typ... | https://stackoverflow.com/questions/79536891/using-zip-on-two-nn-modulelist | python, machine-learning, deep-learning, pytorch, computer-vision | 1,743,012,149 |
se_79403409 | stackoverflow | MACHINE_LEARNING | How to prevent certain input from impacting certain output of neural networks in pytorch? | How to prevent certain input from impacting certain output of neural networks in pytorch?
I have an LSTM model that receives 5 inputs to predict 3 outputs:
import torch
import torch.nn as nn
class LstmModel(nn.Module):
def __init__(self, input_size, hidden_size, output_size):
super(CustomLSTMModel, self).... | https://stackoverflow.com/questions/79403409/how-to-prevent-certain-input-from-impacting-certain-output-of-neural-networks-in | python, deep-learning, pytorch, neural-network, lstm | 1,738,341,577 |
se_52358505 | stackoverflow | MACHINE_LEARNING | Neural Network underfitting breast cancer dataset | Neural Network underfitting breast cancer dataset
I'm trying to create a neural network for binary classification on the breast cancer dataset:
https://www.kaggle.com/uciml/breast-cancer-wisconsin-data
My neural network consists of 3 layers(not including input layer):
first layer: 6 neurons with tanh activation.
sec... | https://stackoverflow.com/questions/52358505/neural-network-underfitting-breast-cancer-dataset | python, machine-learning, neural-network, deep-learning, classification | 1,537,133,094 |
se_45349950 | stackoverflow | MACHINE_LEARNING | Why do I get a low accuracy in this neural network? | Why do I get a low accuracy in this neural network?
I have made a convolutional neural network with tensorflow, i've trained it and tested it (about 98% accuracy)... I saved the model with
saver = tf.train.Saver()
saver.save(sess, 'model.ckpt')
Then i restored with the saver, but i always get an accuracy lower tha... | https://stackoverflow.com/questions/45349950/why-do-i-get-a-low-accuracy-in-this-neural-network | python-3.x, image-processing, tensorflow, deep-learning | 1,501,156,138 |
se_79526774 | stackoverflow | MACHINE_LEARNING | Unable to get the tokenizer of Gemma-3 | Unable to get the tokenizer of Gemma-3
I am trying to get the tokenizer using huggingface AutoTokenizer library, but I am unable to fetch, is there any other way to get it?
Where I am doing wrong?
from transformers import AutoTokenizer
# Load Gemma 3‑27B‑IT’s tokenizer
MODEL_GEMMA = "google/gemma-3-27b-it"
gemma_token... | https://stackoverflow.com/questions/79526774/unable-to-get-the-tokenizer-of-gemma-3 | deep-learning, nlp, huggingface-transformers, huggingface-tokenizers, gemma | 1,742,602,817 |
se_62525680 | stackoverflow | MACHINE_LEARNING | Save only best weights with huggingface transformers | Save only best weights with huggingface transformers
Currently, I'm building a new transformer-based model with huggingface-transformers, where attention layer is different from the original one. I used run_glue.py to check performance of my model on GLUE benchmark. However, I found that Trainer class of huggingface-t... | https://stackoverflow.com/questions/62525680/save-only-best-weights-with-huggingface-transformers | deep-learning, nlp, pytorch, huggingface-transformers | 1,592,873,636 |
se_51422776 | stackoverflow | MACHINE_LEARNING | How do i add ctc beam search decoder in crnn model (pytorch) | How do i add ctc beam search decoder in crnn model (pytorch)
I am following the CRNN implementation of https://github.com/meijieru/crnn.pytorch, but seems like it is not using beam search for decoding the words. Can someone tell me how to add beam search decoding in the same model? At the same time in Tensorflow, ther... | https://stackoverflow.com/questions/51422776/how-do-i-add-ctc-beam-search-decoder-in-crnn-model-pytorch | tensorflow, deep-learning, ocr, speech-recognition, pytorch | 1,532,003,469 |
se_79527486 | stackoverflow | MACHINE_LEARNING | d2l #@save is not working in jupyter notebook | d2l #@save is not working in jupyter notebook
Why is my train_ch3 function with #@save not accessible in other notebooks when using d2l?
I am following the d2l (Dive into Deep Learning) framework and trying to save the train_ch3 function using the #@save annotation so that it can be accessed from other notebooks. Howe... | https://stackoverflow.com/questions/79527486/d2l-save-is-not-working-in-jupyter-notebook | python, deep-learning, jupyter-notebook, d2l | 1,742,648,808 |
se_61688767 | stackoverflow | MACHINE_LEARNING | how does validation_split work in training a neural network model? | how does validation_split work in training a neural network model?
model.fit(X_train, y_train,
validation_data=(X_test, y_test), epochs=10, verbose=2)
in the above line of code model is a sequential keras model having layers and is compiled.
what is the use of the parameter validaiton_data. the model is go... | https://stackoverflow.com/questions/61688767/how-does-validation-split-work-in-training-a-neural-network-model | tensorflow, keras, deep-learning, neural-network | 1,588,975,102 |
se_27319931 | stackoverflow | MACHINE_LEARNING | ReLu and Dropout in CNN | ReLu and Dropout in CNN
I am confused about some layers in Convolutional Neural Networks (CNN).
Regarding ReLu... I just know that it is the sum of an infinite logistic function, but ReLu doesn't connect to any upper layers. Why do we need ReLu, and how does it work?
Regarding Dropout... How does dropout work? I liste... | https://stackoverflow.com/questions/27319931/relu-and-dropout-in-cnn | deep-learning, neural-network, conv-neural-network, dropout | 1,417,795,319 |
se_68839526 | stackoverflow | MACHINE_LEARNING | Different accuracy on google colab | Different accuracy on google colab
I have this CNN:
def cnn(trainImages, trainLabels, testImages, testLabels):
trainImages = np.array(trainImages)
trainLabels = np.array(trainLabels)
testImages = np.array(testImages)
testLabels = np.array(testLabels)
trainImages = trainImages / 255
testImages ... | https://stackoverflow.com/questions/68839526/different-accuracy-on-google-colab | python, tensorflow, deep-learning, conv-neural-network, google-colaboratory | 1,629,322,012 |
se_79525759 | stackoverflow | MACHINE_LEARNING | How to suppress warnings from model.load_state_dict() in PyTorch? | How to suppress warnings from model.load_state_dict() in PyTorch?
I'm loading a model checkpoint using
model.load_state_dict(state_dict, strict=False)
because the model architecture does not fully match the weights. As expected, this results in a warning message like this:
The model and loaded state dict do not match... | https://stackoverflow.com/questions/79525759/how-to-suppress-warnings-from-model-load-state-dict-in-pytorch | machine-learning, deep-learning, pytorch | 1,742,567,636 |
se_79523864 | stackoverflow | MACHINE_LEARNING | How to update model weights from a custom arbitrary loss function in Pytorch? | How to update model weights from a custom arbitrary loss function in Pytorch?
Starting with the end in mind:
Is there anyway I can write that arbitrary loss function by calling some pytorch functions, thus preserving the autograd graph?
How can I ensure my loss function is "wired" to autograd?
If that cannot be done ... | https://stackoverflow.com/questions/79523864/how-to-update-model-weights-from-a-custom-arbitrary-loss-function-in-pytorch | machine-learning, deep-learning, pytorch, loss-function | 1,742,496,823 |
se_60784634 | stackoverflow | MACHINE_LEARNING | How to implement Multi label classification with train, validation and test images with Densenet/ResNet | How to implement Multi label classification with train, validation and test images with Densenet/ResNet
I am working on Multi-Label Image classification using a dataset having 14,720 training images. I need to implement it using ResNet/DenseNet. I trying to work on it. Could you please suggest me a reference to move f... | https://stackoverflow.com/questions/60784634/how-to-implement-multi-label-classification-with-train-validation-and-test-imag | tensorflow, keras, deep-learning, conv-neural-network, multilabel-classification | 1,584,766,881 |
se_76036161 | stackoverflow | MACHINE_LEARNING | Implementing a learning rate warm up and a learning rate schedule using pytorch | Implementing a learning rate warm up and a learning rate schedule using pytorch
I’m trying to implement both a learning rate warmup and a learning rate schedule within my training loop.
I’m currently using this for learning rate warmup, specifically the LinearWarmup(). So this simply ramps up from 0 to max_lr over a g... | https://stackoverflow.com/questions/76036161/implementing-a-learning-rate-warm-up-and-a-learning-rate-schedule-using-pytorch | python, deep-learning, pytorch | 1,681,741,226 |
se_79484562 | stackoverflow | MACHINE_LEARNING | ImageDataGenerator is throwing Invalid Argument Error | ImageDataGenerator is throwing Invalid Argument Error
I am working on an Image classification problem with ImageDataGenerator from the keras library. Here is what my script looks like
datagen = ImageDataGenerator(rescale=1./255, validation_split=0.2)
train_generator = datagen.flow_from_directory(
alzeihmers,
... | https://stackoverflow.com/questions/79484562/imagedatagenerator-is-throwing-invalid-argument-error | python, tensorflow, keras, deep-learning, conv-neural-network | 1,741,112,711 |
se_72923901 | stackoverflow | MACHINE_LEARNING | Implement Physics informed Neural Network using pytorch | Implement Physics informed Neural Network using pytorch
I found a very interesting paper, Physics Informed Deep Learning (Part I): Data-driven Solutions of Nonlinear Partial Differential Equations and want to give it a trial. For this, I create a dummy problem and implement what I understand from the paper.
Problem St... | https://stackoverflow.com/questions/72923901/implement-physics-informed-neural-network-using-pytorch | python, deep-learning, neural-network, pytorch | 1,657,392,895 |
se_69776434 | stackoverflow | MACHINE_LEARNING | DCGAN producing noise but not expected structure, Can someone help me get proper results out of a DCGAN? | DCGAN producing noise but not expected structure, Can someone help me get proper results out of a DCGAN?
Can someone help me get proper results/images from my DCGAN ?
I'm getting different colored (noise) pictures from one
iteration to another, but not anywhere close to what I should
get. I'm feeding Human faces/Cats/... | https://stackoverflow.com/questions/69776434/dcgan-producing-noise-but-not-expected-structure-can-someone-help-me-get-proper | python, deep-learning, generative-adversarial-network | 1,635,562,381 |
se_79515545 | stackoverflow | MACHINE_LEARNING | CNN Autoencoder takes a very long time to train | CNN Autoencoder takes a very long time to train
I have been training a CNN Autoencoder on binary images (pixels are either 0 or 1) of size 64x64. The model is shown below:
import torch
import torch.nn as nn
import torch.nn.functional as F
class CNNAutoencoder(nn.Module):
"""
Input shape: (B, 1, 64, 64)
""... | https://stackoverflow.com/questions/79515545/cnn-autoencoder-takes-a-very-long-time-to-train | python, deep-learning, pytorch, conv-neural-network, autoencoder | 1,742,239,137 |
se_79515161 | stackoverflow | MACHINE_LEARNING | Using vmap to parallelize multiple models input in JAX / Flax.nnx | Using vmap to parallelize multiple models input in JAX / Flax.nnx
I have a function that is roughly as follows
from flax import nnx
from jax import Array
from typing import List
def predict(models: List[nnx.Module], imgs: Array):
for i, agent in enumerate(agents):
prediction = models(imgs[i, ...])
I want ... | https://stackoverflow.com/questions/79515161/using-vmap-to-parallelize-multiple-models-input-in-jax-flax-nnx | python-3.x, deep-learning, gpu, vectorization, jax | 1,742,228,648 |
se_79505082 | stackoverflow | MACHINE_LEARNING | Tensorflow error unknown expected keyword during loading of trained model | Tensorflow error unknown expected keyword during loading of trained model
I have trained a Tensorflow model and saved it on another machine and want to load it locally. When i try to load it i get an error saying Agent.init() got an unexpected keyword argument 'name'. My Agent class is the neural net i want to load bu... | https://stackoverflow.com/questions/79505082/tensorflow-error-unknown-expected-keyword-during-loading-of-trained-model | python, tensorflow, keras, deep-learning, neural-network | 1,741,822,176 |
se_72552272 | stackoverflow | MACHINE_LEARNING | Strange behaviour when passing a function into a Tensorflow dataset map method | Strange behaviour when passing a function into a Tensorflow dataset map method
This was working perfectly fine for me earlier today, but it suddenly started behaving very strangely when I restarted my notebook.
I have a tf dataset that takes in numpy files and their corresponding labels as input, like so tf.data.Datas... | https://stackoverflow.com/questions/72552272/strange-behaviour-when-passing-a-function-into-a-tensorflow-dataset-map-method | python, tensorflow, machine-learning, deep-learning, tensorflow-datasets | 1,654,722,817 |
se_65288033 | stackoverflow | MACHINE_LEARNING | How TVM is different from MLIR? | How TVM is different from MLIR?
As per my understanding, both TVM and MLIR are used as compiler infrastructure for deep learning neural networks. Is my understanding correct?.
And Which would be better if we are building a compiler for custom hardware that runs deep learning inferences? | https://stackoverflow.com/questions/65288033/how-tvm-is-different-from-mlir | deep-learning, compiler-construction, apache-tvm | 1,607,944,510 |
se_79502682 | stackoverflow | MACHINE_LEARNING | torch cannot load a pth file containing plotly figures | torch cannot load a pth file containing plotly figures
I am running a bunch of DNN experiments using pytorch, and saving an instance of my ExperimentClass as a .pth file. The ExperimentClass has instance variables including a torch model, a dictionary of multiple plotly figure objects, dataframes, and other metadata r... | https://stackoverflow.com/questions/79502682/torch-cannot-load-a-pth-file-containing-plotly-figures | deep-learning, pytorch, plotly, pth | 1,741,756,093 |
se_58114417 | stackoverflow | MACHINE_LEARNING | My model's loss value decreases slowly .how to reduce my loss faster while training? | My model's loss value decreases slowly .how to reduce my loss faster while training?
when I train the model the loss decrease from 0.9 to 0.5 in 2500 epochs. Is it normal?
my model:
model = Sequential()
model.add(Embedding(vocab_size , emd_dim, weights=[emd_matrix], input_length=maxLen,trainable=False)... | https://stackoverflow.com/questions/58114417/my-models-loss-value-decreases-slowly-how-to-reduce-my-loss-faster-while-train | tensorflow, keras, neural-network, deep-learning, nlp | 1,569,492,445 |
se_79504547 | stackoverflow | MACHINE_LEARNING | LogVar layer of a VAE only returns zeros | LogVar layer of a VAE only returns zeros
I'm building a Variational auto encoder (VAE) with tfjs.
For now I'm only exploring with the fashionMNIST dataset and a simple model as follows:
input layer (28*28*1)
flatten
intermediate_1 (dense 50 units - relu)
mean (dense 10 units - relu) // logVar (dense 10 units relu)
Sam... | https://stackoverflow.com/questions/79504547/logvar-layer-of-a-vae-only-returns-zeros | machine-learning, deep-learning, loss-function, tensorflow.js, autoencoder | 1,741,803,602 |
se_69394501 | stackoverflow | MACHINE_LEARNING | How can I use BERT for address matching problem? | How can I use BERT for address matching problem?
I am building an address matching algorithm. The main problem is that previous models like Conditional Random fields (CRF)from Paserator and Averaged Perceptron from Libpostal do not match address entities correctly.
I am using the free sample from AddressBases premium ... | https://stackoverflow.com/questions/69394501/how-can-i-use-bert-for-address-matching-problem | python, deep-learning, text-parsing, bert-language-model, named-entity-recognition | 1,633,013,929 |
se_79500227 | stackoverflow | MACHINE_LEARNING | Why am I getting RuntimeError: no running event loop and in my VS code when I am trying to run my command streamlit run main.py? | Why am I getting RuntimeError: no running event loop and in my VS code when I am trying to run my command streamlit run main.py?
I am trying to build a conversational chatbot using VS Code. The code is following:
## RAG Q&A Conversation With PDF Including Chat History
import streamlit as st
from langchain.chains impor... | https://stackoverflow.com/questions/79500227/why-am-i-getting-runtimeerror-no-running-event-loop-and-in-my-vs-code-when-i-am | machine-learning, deep-learning, artificial-intelligence, chatbot, langchain | 1,741,685,646 |
se_79503853 | stackoverflow | MACHINE_LEARNING | PyTorch Forecasting TimeSeriesDataSet Returns None in DataLoader Batch | PyTorch Forecasting TimeSeriesDataSet Returns None in DataLoader Batch
I am working with pytorch-forecasting to create a TimeSeriesDataSet where I have 30 target variables that I want to predict.
However, when I pass this dataset to a DataLoader, I encounter an issue:
Expected Behavior
Since I have 30 target variables... | https://stackoverflow.com/questions/79503853/pytorch-forecasting-timeseriesdataset-returns-none-in-dataloader-batch | tensorflow, deep-learning, time-series, pytorch-dataloader, pytorch-forecasting | 1,741,788,461 |
se_78259767 | stackoverflow | MACHINE_LEARNING | YOLOv8, display bounding boxes on the screen | YOLOv8, display bounding boxes on the screen
How to display bounding boxes directly on the screen? Its not a video, so I can't use tracking. My program captures the whole screen and checks for Objects. I researched that CV can help me with that but I can't get it to work
from ultralytics import YOLO
import pyautogui
i... | https://stackoverflow.com/questions/78259767/yolov8-display-bounding-boxes-on-the-screen | python, deep-learning, yolo, yolov8, ultralytics | 1,712,044,735 |
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_79498420 | stackoverflow | MACHINE_LEARNING | Computing Gradient of Loss w.r.t Learning Rate PyTorch | Computing Gradient of Loss w.r.t Learning Rate PyTorch
I am building a custom optimizer that samples learning rates from a Dirichlet distribution, whose parameters (alpha) need to be updated in each backpropagation. I've already figured out how to get the loss w.r.t. to these alpha parameters, effectively this would b... | https://stackoverflow.com/questions/79498420/computing-gradient-of-loss-w-r-t-learning-rate-pytorch | machine-learning, optimization, deep-learning, pytorch, backpropagation | 1,741,619,462 |
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_62102289 | stackoverflow | MACHINE_LEARNING | Impact of large dataset on the trained model size? | Impact of large dataset on the trained model size?
If the dataset is large does it mean that the model size will also be large? | https://stackoverflow.com/questions/62102289/impact-of-large-dataset-on-the-trained-model-size | deep-learning, dataset, large-data | 1,590,840,901 |
se_79497184 | stackoverflow | MACHINE_LEARNING | How to calculate FPS in image classification? | How to calculate FPS in image classification?
Please, I would appreciate some help and will be grateful for any help.
I have some doubts about how to calculate the frame rate (FPS) in image classification for training an testing routines. I've already searched internet, github, chatgpt etc, but I'm still not sure and ... | https://stackoverflow.com/questions/79497184/how-to-calculate-fps-in-image-classification | python, deep-learning, frame-rate, image-classification | 1,741,588,537 |
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_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_60154164 | stackoverflow | MACHINE_LEARNING | Detection and recognition text from Tyres (python) | Detection and recognition text from Tyres (python)
Hi i have bunch of images of tyres, we need to detect and recognize the text on the tyres,
here i am facing difficulties to detect the text, because the text and background of the tyre are same, i have tried with EAST text detector and yolo text detector ( without ow... | https://stackoverflow.com/questions/60154164/detection-and-recognition-text-from-tyres-python | python-3.x, opencv, text, deep-learning, computer-vision | 1,581,350,834 |
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_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_79453817 | stackoverflow | MACHINE_LEARNING | ONNX export stops without error and no onnx file is generated | ONNX export stops without error and no onnx file is generated
I'm trying to export my PyTorch model to ONNX format while ensuring that the batch size remains dynamic. the result always is Segmentation fault (core dumped) Here’s the code I’m using:
import torch # Import PyTorch library
# Create a dummy input tensor o... | https://stackoverflow.com/questions/79453817/onnx-export-stops-without-error-and-no-onnx-file-is-generated | python, deep-learning, deployment, pytorch, onnx | 1,740,040,705 |
se_52252442 | stackoverflow | MACHINE_LEARNING | How to handle Shift in Forecasted value | How to handle Shift in Forecasted value
I implemented a forecasting model using LSTM in Keras. The dataset is 15mints seperated and I am forecasting for 12 future steps.
The model performs good for the problem. But there is a small problem with the forecast made. It is showing a small shift effect. To get a more cle... | https://stackoverflow.com/questions/52252442/how-to-handle-shift-in-forecasted-value | python, machine-learning, keras, deep-learning, forecasting | 1,536,562,128 |
se_79482841 | stackoverflow | MACHINE_LEARNING | what is wandb in Google Colab and why do we use it? | what is wandb in Google Colab and why do we use it?
here is the screenshot from google colab
I was preparing a YOLOv9 model. And i saw this wandb stuff. But as I remember there were no wand warnings a few months ago. I don't get the difference of using wandb or not.
Can someone explain?
I just waited for the time is u... | https://stackoverflow.com/questions/79482841/what-is-wandb-in-google-colab-and-why-do-we-use-it | deep-learning, google-colaboratory, wandb | 1,741,070,728 |
se_79303178 | stackoverflow | MACHINE_LEARNING | How can I configure OpenVINO to automatically use GPU, CPU, or NPU for model inference? | How can I configure OpenVINO to automatically use GPU, CPU, or NPU for model inference?
1)I am working on an AI/ML project using Windows and an Intel processor system. My model is based on OpenVINO. How can I load the model such that it automatically detects the available functionality (CPU, GPU, or NPU) and selects t... | https://stackoverflow.com/questions/79303178/how-can-i-configure-openvino-to-automatically-use-gpu-cpu-or-npu-for-model-inf | deep-learning, intel, huggingface-transformers, openvino, aiml | 1,734,959,394 |
se_76998222 | stackoverflow | MACHINE_LEARNING | Is it possible to adjust some parameters in huggingface pipeline to avoid repeated text in output? | Is it possible to adjust some parameters in huggingface pipeline to avoid repeated text in output?
I am a novice in huggingface, I am confused in the mechanism of 'text-generation' in pipeline,take a simple example,
from transformers import pipeline, set_seed
generator = pipeline('text-generation', model="facebook/opt... | https://stackoverflow.com/questions/76998222/is-it-possible-to-adjust-some-parameters-in-huggingface-pipeline-to-avoid-repeat | python, deep-learning, huggingface-transformers | 1,693,294,424 |
se_45909024 | stackoverflow | MACHINE_LEARNING | Using the dev set or the train set | Using the dev set or the train set
Can someone clear up this doubt of mine.
While evaluating the model, we should try a smaller set. the dev set is a small set. So we try something on the dev set and come to a conclusion and then go to the train set to train it properly and check.
OR
We train the training set and e... | https://stackoverflow.com/questions/45909024/using-the-dev-set-or-the-train-set | machine-learning, deep-learning | 1,503,865,495 |
se_54242123 | stackoverflow | MACHINE_LEARNING | Order of layers in hidden states in PyTorch GRU return | Order of layers in hidden states in PyTorch GRU return
This is the API I am looking at, https://pytorch.org/docs/stable/nn.html#gru
It outputs:
output of shape (seq_len, batch, num_directions * hidden_size)
h_n of shape (num_layers * num_directions, batch, hidden_size)
For GRU with more than one layers, I wonder ... | https://stackoverflow.com/questions/54242123/order-of-layers-in-hidden-states-in-pytorch-gru-return | deep-learning, pytorch, recurrent-neural-network, tensor, gated-recurrent-unit | 1,547,749,681 |
se_60144922 | stackoverflow | MACHINE_LEARNING | RuntimeError: cuDNN version mismatch: PyTorch was compiled against 7102 but linked against 7604 | RuntimeError: cuDNN version mismatch: PyTorch was compiled against 7102 but linked against 7604
I got this error when running training a deep learning model and although looking at many solutions over the Internet, they did not help me. The log is as follows:
Traceback (most recent call last):
File "main.py", line ... | https://stackoverflow.com/questions/60144922/runtimeerror-cudnn-version-mismatch-pytorch-was-compiled-against-7102-but-link | python, deep-learning, pytorch, cudnn | 1,581,315,079 |
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_78620402 | stackoverflow | MACHINE_LEARNING | Dataloader error in pytorch PascalVOC dataset: RuntimeError: each element in list of batch should be of equal size | Dataloader error in pytorch PascalVOC dataset: RuntimeError: each element in list of batch should be of equal size
When trying to implement the yolo algortithm, one of the steps is to resize each image to (448, 448). But even with the transform applied the Dataloader throw an exception about difference of size in the ... | https://stackoverflow.com/questions/78620402/dataloader-error-in-pytorch-pascalvoc-dataset-runtimeerror-each-element-in-lis | machine-learning, deep-learning, pytorch, yolo, pytorch-dataloader | 1,718,318,629 |
se_79469831 | stackoverflow | MACHINE_LEARNING | Using binary ({0,1}) weights in a Neural Network layer | Using binary ({0,1}) weights in a Neural Network layer
I want to create a custom linear (not fully connected) layer in Pytorch. What is special in this layer is that I need its weights to be binary (0 or 1), so that this layer acts as a "mask", masking out these features that get a weight of 0. Since backpropagation i... | https://stackoverflow.com/questions/79469831/using-binary-0-1-weights-in-a-neural-network-layer | python, machine-learning, deep-learning, pytorch, neural-network | 1,740,574,940 |
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_75693007 | stackoverflow | MACHINE_LEARNING | Pytorch RuntimeError: mat1 & mat2 shapes cannot be multiplied | Pytorch RuntimeError: mat1 & mat2 shapes cannot be multiplied
I am building a CNN on Pytorch and getting the following error message:
RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x32768 and
512x256)
I have built the following model:
def classifier_block(input, output, kernel_size, stride, last_laye... | https://stackoverflow.com/questions/75693007/pytorch-runtimeerror-mat1-mat2-shapes-cannot-be-multiplied | python, machine-learning, deep-learning, pytorch, conv-neural-network | 1,678,430,896 |
se_60398211 | stackoverflow | MACHINE_LEARNING | Predicted Image id and box from SSD | Predicted Image id and box from SSD
How to find predicted image id and Box from SSD, I am using this GitHub link here is the test function which I want to save the image id and box
def test(loader, net, criterion, device):
net.eval()
running_loss = 0.0
running_regression_loss = 0.0
running_classificati... | https://stackoverflow.com/questions/60398211/predicted-image-id-and-box-from-ssd | python, machine-learning, deep-learning, pytorch, neural-network | 1,582,644,961 |
se_79460310 | stackoverflow | MACHINE_LEARNING | loss.backward() takes 10 times the time of network.forward() | loss.backward() takes 10 times the time of network.forward()
I want to train my model using own loss function, however I noticed that loss.backward() takes 2 seconds and learning iteration without this function takes only 0.2 seconds.
I tried to optimize the calculation graph but it didnt do much. All of the tensors a... | https://stackoverflow.com/questions/79460310/loss-backward-takes-10-times-the-time-of-network-forward | python, deep-learning, pytorch | 1,740,258,270 |
se_59986353 | stackoverflow | MACHINE_LEARNING | Why do i have to convert "uint8" into "float32" | Why do i have to convert "uint8" into "float32"
I just started looking into deep learning and started to build a CNN with Keras.
So I've noticed that oftentimes when the Dataset MNIST is used, after importing the images, they are getting converted to float32-Datatype.
So my question is, why is ... | https://stackoverflow.com/questions/59986353/why-do-i-have-to-convert-uint8-into-float32 | python, keras, deep-learning, mnist | 1,580,388,311 |
se_79457237 | stackoverflow | MACHINE_LEARNING | fit function stops after epoch 1 | fit function stops after epoch 1
I have implemented this function to fit the model
def fit_model(model, X_train_sequence_tensor,Y_train_sequence_tensor, epochs, val_set, time_windows, scaler):
X_column_list = [item for item in val_set.columns.to_list() if item not in ['date', 'user', 'rank','rank_group', 'cou... | https://stackoverflow.com/questions/79457237/fit-function-stops-after-epoch-1 | python, machine-learning, deep-learning | 1,740,137,210 |
se_55831235 | stackoverflow | MACHINE_LEARNING | Calculating the Number of flops for a given Neural Network? | Calculating the Number of flops for a given Neural Network?
I have a neural network (ALEXnet or VGG16) written with Keras for Image Classification and I would like to calculate the number of floating point operations for a network. The size of the images in the dataset could vary.
Can a generalized code be written in ... | https://stackoverflow.com/questions/55831235/calculating-the-number-of-flops-for-a-given-neural-network | machine-learning, deep-learning, conv-neural-network, flops | 1,556,112,512 |
se_76248695 | stackoverflow | MACHINE_LEARNING | d2l package installation on google colab | d2l package installation on google colab
I need to intall d2l package with
pip install d2l==1.0.0b0
However, whenever I try to download it to google colab, the following error occurs:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting d2l==1.0.0-beta0
Using... | https://stackoverflow.com/questions/76248695/d2l-package-installation-on-google-colab | machine-learning, deep-learning, d2l | 1,684,083,575 |
se_69357610 | stackoverflow | MACHINE_LEARNING | ModuleNotFoundError: No module named 'Model' issues in Training Images | ModuleNotFoundError: No module named 'Model' issues in Training Images
I am trying to do a program with the help of some resources. Suddenly, I got an import error.
import cv2
import numpy as np
from PIL import Image
import os
import numpy as np
import cv2
import os
import h5py
#import dlib
from imutils import... | https://stackoverflow.com/questions/69357610/modulenotfounderror-no-module-named-model-issues-in-training-images | python-3.x, keras, deep-learning, conv-neural-network, tensorflow2.0 | 1,632,814,885 |
se_61775967 | stackoverflow | MACHINE_LEARNING | How to run cv::dnn::blobFromImages on multiple images and interpret it? | How to run cv::dnn::blobFromImages on multiple images and interpret it?
I need to run cv::dnn::blobFromImages on multiple images in C++, in order to detect objects, faster than one image for cv::dnn::blobFromImage. But as you know blob is a Mat file, so how could I check result on second , third and ... images?
cv::M... | https://stackoverflow.com/questions/61775967/how-to-run-cvdnnblobfromimages-on-multiple-images-and-interpret-it | c++, opencv, deep-learning, yolo | 1,589,376,605 |
se_75039200 | stackoverflow | MACHINE_LEARNING | run(): incompatible function arguments in onnxruntime | run(): incompatible function arguments in onnxruntime
In doing inference on mobilenet 0.25 model-In face detection task-, I prefer to convert model to ONNX. Then, I used a simple code to do inference like this one:
import onnx
import onnxruntime
import cv2
import numpy as np
import time
import sys
import onnx
from on... | https://stackoverflow.com/questions/75039200/run-incompatible-function-arguments-in-onnxruntime | deep-learning, face-detection, onnx, onnxruntime, mobilenet | 1,673,082,795 |
se_67934643 | stackoverflow | MACHINE_LEARNING | Pytorch inferencing from the model is giving me different results every time | Pytorch inferencing from the model is giving me different results every time
I have created and trained one very simple network in pytorch as shown below:
self.task_layers[task][task_layer_key]; TaskLayerManager(
(taskLayers): ModuleList(
(0): lc_hidden(
(dropout_layer): Dropout(p=0.0, inplace=False)
... | https://stackoverflow.com/questions/67934643/pytorch-inferencing-from-the-model-is-giving-me-different-results-every-time | python, deep-learning, pytorch, torch | 1,623,404,283 |
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_79429107 | stackoverflow | MACHINE_LEARNING | How can I resolve "RuntimeError: The size of tensor a (64) must match the size of tensor b (6) at non-singleton dimension 1"? | How can I resolve "RuntimeError: The size of tensor a (64) must match the size of tensor b (6) at non-singleton dimension 1"?
I am training a diffusion model for an image-to-image translation task. Image size is 128 by 128, and batch size is 8 (due to memory limitations).
This is the model I am using:
class ... | https://stackoverflow.com/questions/79429107/how-can-i-resolve-runtimeerror-the-size-of-tensor-a-64-must-match-the-size-o | python, machine-learning, deep-learning, stable-diffusion, image-translation | 1,739,256,498 |
se_51403712 | stackoverflow | MACHINE_LEARNING | Implementation of AlexNet in Keras on cifar-10 gives poor accuracy | Implementation of AlexNet in Keras on cifar-10 gives poor accuracy
I tried implementing AlexNet as explained in this video. Pardon me if I have implemented it wrong, this is the code for my implementation it in keras.
Edit : The cifar-10 ImageDataGenerator
cifar_generator = ImageDataGenerator()
cifar_data = cifar... | https://stackoverflow.com/questions/51403712/implementation-of-alexnet-in-keras-on-cifar-10-gives-poor-accuracy | machine-learning, keras, neural-network, deep-learning, conv-neural-network | 1,531,921,675 |
se_72434944 | stackoverflow | MACHINE_LEARNING | Grad-CAM for multivariate timeseries | Grad-CAM for multivariate timeseries
I would like to use grad-CAM to add explainability to my model train on multiple multivariate timeseries.
The idea would be to have something like this :
I found a couple of paper that do it (Explainable Deep Neural Networks for Multivariate Time Series Predictions, XCM: An Explai... | https://stackoverflow.com/questions/72434944/grad-cam-for-multivariate-timeseries | python, deep-learning, time-series, conv-neural-network, xai | 1,653,916,445 |
se_58848100 | stackoverflow | MACHINE_LEARNING | Is there a similar function in tensorflow like load_state_dict() in Pytorch? | Is there a similar function in tensorflow like load_state_dict() in Pytorch?
Like it has been described, I am wondering is there a similar function in tensorflow for load_state_dict() like the one does in Pytorch. To demonstrate a scenario, please refer to the code following:
# Suppose we have two correctly initiali... | https://stackoverflow.com/questions/58848100/is-there-a-similar-function-in-tensorflow-like-load-state-dict-in-pytorch | tensorflow, neural-network, deep-learning, pytorch | 1,573,695,191 |
se_79433640 | stackoverflow | MACHINE_LEARNING | Python: Deep Q Learning agent doesn't seem to learn | Python: Deep Q Learning agent doesn't seem to learn
I am using gymnasium and torch. I initially created a custom environment by following the official gymnasium's guide: it shows you how to build a NxN Box where the agent needs to reach a randomly placed target by moving right, up, left or down.
I modified it so t... | https://stackoverflow.com/questions/79433640/python-deep-q-learning-agent-doesnt-seem-to-learn | python, deep-learning, pytorch, agent, gymnasium | 1,739,374,552 |
se_75201281 | stackoverflow | MACHINE_LEARNING | Image segmentation with UNet is mainly white | Image segmentation with UNet is mainly white
I'm working with MONAI library in order to segment brain tumor in MRI images. My dataset is composed of 500 patients and for each patient there're three types of images and the segmentation mask.
I've trained my network (UNet architecture) but I've a problem during the infe... | https://stackoverflow.com/questions/75201281/image-segmentation-with-unet-is-mainly-white | image-processing, deep-learning, image-segmentation, medical-imaging, unet-neural-network | 1,674,398,148 |
se_79409149 | stackoverflow | MACHINE_LEARNING | Why do I have to unsqueeze the data from torch.Size([50]) to torch.Size([50, 1]) | Why do I have to unsqueeze the data from torch.Size([50]) to torch.Size([50, 1])
I was doing the PyTorch Deep Learning course from FreeCodeCamp and the doubt is:
weight = 0.7
bias = 0.3
start = 0
end = 1
step = 0.02
X = torch.arange(start, end, step).unsqueeze(dim=1)
y=weight*X + bias
X[:10], y[:10]
train_split=int(0... | https://stackoverflow.com/questions/79409149/why-do-i-have-to-unsqueeze-the-data-from-torch-size50-to-torch-size50-1 | python, machine-learning, deep-learning, pytorch | 1,738,593,848 |
se_79422978 | stackoverflow | MACHINE_LEARNING | Different concate dimension parameters in the up-and-down sampling phase of U-shaped networks in the diffusion model | Different concate dimension parameters in the up-and-down sampling phase of U-shaped networks in the diffusion model
The error I am getting is
File "/media/xd/hdd/wxy/spectraldiff_diffusion-master/codes/unet3d.py", line 113, in forward
x = torch.cat((x, residual_x), dim=1)
RuntimeError: Sizes of tensors must ma... | https://stackoverflow.com/questions/79422978/different-concate-dimension-parameters-in-the-up-and-down-sampling-phase-of-u-sh | python, machine-learning, deep-learning, pytorch, neural-network | 1,739,009,674 |
se_79393673 | stackoverflow | MACHINE_LEARNING | Python Object detection multiprocessing speed issue | Python Object detection multiprocessing speed issue
I'm trying to implement a multiprocessing version of object detection (video source can be both camera or video) with YOLO model of ultralytics.
I implemented a Queue where to add frames and a process pool with 4 workers: 1 shows the image and the other 3 process the... | https://stackoverflow.com/questions/79393673/python-object-detection-multiprocessing-speed-issue | python, deep-learning, python-multiprocessing, yolo, ultralytics | 1,738,064,561 |
se_52656692 | stackoverflow | MACHINE_LEARNING | Debugging in Google Colab | Debugging in Google Colab
I am running the following code snippet in google colab in a single cell:
%debug
# Create tensors of shape (10, 3) and (10, 2).
x = torch.randn(10, 3)
y = torch.randn(10, 2)
# Build a fully connected layer.
linear = nn.Linear(3, 2)
print ('w: ', linear.weight)
print ('b: ', linear.bias)
I... | https://stackoverflow.com/questions/52656692/debugging-in-google-colab | python, deep-learning, pytorch, tensor, google-colaboratory | 1,538,698,514 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.