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_46270122 | stackoverflow | MACHINE_LEARNING | Avoiding vanishing gradient in deep neural networks | Avoiding vanishing gradient in deep neural networks
I'm taking a look at Keras to try to dive into deep learning.
From what I know, stacking just a few dense layers effectively stops back propagation from working due to vanishing gradient problem.
I found out that there is a pre-trained VGG-16 neural network you can... | https://stackoverflow.com/questions/46270122/avoiding-vanishing-gradient-in-deep-neural-networks | machine-learning, keras, deep-learning, neural-network, keras-layer | 1,505,695,187 |
se_78879312 | stackoverflow | MACHINE_LEARNING | Nifty50 data science project in python Error occuring KeyError: 'Date' | Nifty50 data science project in python Error occuring KeyError: 'Date'
I am working on Nifty50 dataset as my Data science project but this error occurs when I'm trying to implement datetime. Please help me?
This is my code to change Date which is an object into datetime:
nfty50_data['Date'] = pd.to_datetime(ni... | https://stackoverflow.com/questions/78879312/nifty50-data-science-project-in-python-error-occuring-keyerror-date | python, database, deep-learning, data-science, project | 1,723,814,133 |
se_78913782 | stackoverflow | MACHINE_LEARNING | How can I run python package using Google Collab? | How can I run python package using Google Collab?
I want to run the DAN repo. I am using Google Cloud Collab. I cloned the project on my Google Drive in the following directory /content/drive/MyDrive/DAN/DAN
Trying to run An example script file is available at OCR/document_OCR/dan/predict_examples to recognize images ... | https://stackoverflow.com/questions/78913782/how-can-i-run-python-package-using-google-collab | python, deep-learning, package, google-colaboratory | 1,724,665,922 |
se_69240517 | stackoverflow | MACHINE_LEARNING | What is the best choice for an activation function in case of small sized neural networks | What is the best choice for an activation function in case of small sized neural networks
I am using pytorch and autograd to build my neural network architecture. It is a small 3 layered network with a sinngle input and output. Suppose I have to predict some output function based on some initial conditions and I am us... | https://stackoverflow.com/questions/69240517/what-is-the-best-choice-for-an-activation-function-in-case-of-small-sized-neural | python, machine-learning, deep-learning, pytorch, activation-function | 1,632,028,849 |
se_49161652 | stackoverflow | MACHINE_LEARNING | How to get around in place operation error if index leaf variable for gradient update? | How to get around in place operation error if index leaf variable for gradient update?
I am encountering In place operation error when I am trying to index a leaf variable to update gradients with customized Shrink function. I cannot work around it. Any help is highly appreciated!
import torch.nn as nn
import torch
i... | https://stackoverflow.com/questions/49161652/how-to-get-around-in-place-operation-error-if-index-leaf-variable-for-gradient-u | python, neural-network, deep-learning, gradient-descent, pytorch | 1,520,458,747 |
se_28462891 | stackoverflow | MACHINE_LEARNING | Step function computational limitations | Step function computational limitations
What are the limits on step functions as activation functions for neural networks?
I've heard nonlinear functions are needed for universality, but where do step functions stand in this? Are they as limited as linear activation functions? Would they classify as linear? | https://stackoverflow.com/questions/28462891/step-function-computational-limitations | machine-learning, deep-learning, neural-network, activation-function | 1,423,683,018 |
se_78911839 | stackoverflow | MACHINE_LEARNING | why get different accuracy every time run program | why get different accuracy every time run program
I train a model with keras tensorflow in python.
Also as you can see in the below code, I used seed parameter, but every time I run same code with same data, I face with different accuracy percentage.
My code:
#Seed
tf.random.set_seed(42)
np.random.seed(42)
set_random_... | https://stackoverflow.com/questions/78911839/why-get-different-accuracy-every-time-run-program | python, tensorflow, machine-learning, keras, deep-learning | 1,724,606,744 |
se_37953585 | stackoverflow | MACHINE_LEARNING | SGD(Stochastic Gradient Descent) vs Backpropagation | SGD(Stochastic Gradient Descent) vs Backpropagation
Can you please tell me the difference between Stochastic Gradient Descent(SGD) and Backpropagation? | https://stackoverflow.com/questions/37953585/sgdstochastic-gradient-descent-vs-backpropagation | machine-learning, deep-learning, artificial-intelligence, gradient-descent, backpropagation | 1,466,539,359 |
se_52014332 | stackoverflow | MACHINE_LEARNING | Adam Optimizer vs Gradient Descent | Adam Optimizer vs Gradient Descent
I am trying to understand what is the difference between these Adam Optimizer and Gradient Descent Optimizer and which one is the best to use in which situation. I am looking into TF website, but if you know of place where these are explained in a better and easy to understand way, l... | https://stackoverflow.com/questions/52014332/adam-optimizer-vs-gradient-descent | python-3.x, tensorflow, machine-learning, neural-network, deep-learning | 1,535,175,044 |
se_62838605 | stackoverflow | MACHINE_LEARNING | Mini-batch performs poorly than Batch gradient descent? | Mini-batch performs poorly than Batch gradient descent?
I am able to get pretty good results from batch gradient descent(batch size 37000) but when I try out mini-batch gradient descent, I get very poor results (even with adam and dropout).
In batch gd, I'm able to get 100% train and 97% dev/cv accuracy.
Whereas in mi... | https://stackoverflow.com/questions/62838605/mini-batch-performs-poorly-than-batch-gradient-descent | deep-learning, neural-network, gradient-descent, mini-batch | 1,594,398,687 |
se_71211496 | stackoverflow | MACHINE_LEARNING | Does batch size affects on the accuracy of a model? | Does batch size affects on the accuracy of a model?
I have trained the Cifar100 dataset using ResNet18 backbone with the proposed technique for the research propose, and I ends up getting some surprising results. I have gone for the two attempts first with the 640 batch size and second one with 320 batch size. The res... | https://stackoverflow.com/questions/71211496/does-batch-size-affects-on-the-accuracy-of-a-model | machine-learning, deep-learning, neural-network, conv-neural-network, batchsize | 1,645,469,097 |
se_78904715 | stackoverflow | MACHINE_LEARNING | YOLOv10: how to interpret training progress info? | YOLOv10: how to interpret training progress info?
I'm training YOLOv10 with this code:
model.train(
.........
epochs=250,
batch=16,
verbose=True,
save=True,
save_period=1,
time=4,
.........
)
I'm trying various VM/GPU options to calculate the most cost-effective options for training, so I run it many ... | https://stackoverflow.com/questions/78904715/yolov10-how-to-interpret-training-progress-info | machine-learning, deep-learning, yolo, ultralytics | 1,724,397,152 |
se_58269460 | stackoverflow | MACHINE_LEARNING | What is 'mini-batch' in deep learning? | What is 'mini-batch' in deep learning?
I'm taking the fast-ai course, and in "Lesson 2 - SGD" it says:
Mini-batch: a random bunch of points that you use to update your weights
And it also says that gradient descent uses mini-batches.
What is a mini-batch? What's the difference between a mini-batch and a reg... | https://stackoverflow.com/questions/58269460/what-is-mini-batch-in-deep-learning | deep-learning, computer-science, cross-validation, fast-ai, mini-batch | 1,570,450,899 |
se_42881516 | stackoverflow | MACHINE_LEARNING | Confusion with batch, stochastic and mini-batch gradient descent | Confusion with batch, stochastic and mini-batch gradient descent
I'm working on some convolutional neural network stuff and I've been reading up the difference between these three and am having some issues. I'm looking at this website http://sebastianruder.com/optimizing-gradient-descent/.
In it, the author says it co... | https://stackoverflow.com/questions/42881516/confusion-with-batch-stochastic-and-mini-batch-gradient-descent | machine-learning, optimization, deep-learning, mini-batch, sgd | 1,489,883,419 |
se_50751276 | stackoverflow | MACHINE_LEARNING | What is the real meaning of training steps in deep learning Tensorflow? | What is the real meaning of training steps in deep learning Tensorflow?
I am following this tutorial about Google Cloud Platform (GCP) for deep learning. According to the tutorial it says:
The --train_steps option specifies the total number of training batches.
However, in the code of the same tutorial it says:
'--... | https://stackoverflow.com/questions/50751276/what-is-the-real-meaning-of-training-steps-in-deep-learning-tensorflow | tensorflow, google-cloud-platform, deep-learning, definition | 1,528,412,679 |
se_31155388 | stackoverflow | MACHINE_LEARNING | What is an Epoch in Neural Networks Training | What is an Epoch in Neural Networks Training
While I'm reading in how to build ANN in pybrain, they say:
Train the network for some epochs. Usually you would set something
like 5 here,
trainer.trainEpochs( 1 )
I looked for what is that mean , then I conclude that we use an epoch of data to update weights, If I choo... | https://stackoverflow.com/questions/31155388/what-is-an-epoch-in-neural-networks-training | machine-learning, deep-learning, neural-network, artificial-intelligence, pybrain | 1,435,736,646 |
se_44728913 | stackoverflow | MACHINE_LEARNING | how the generator is trained with the output of discriminator in Generative adversarial Networks | how the generator is trained with the output of discriminator in Generative adversarial Networks
Recently I have learned about Generative Adversarial Networks.
For training the Generator, I am somehow confused how it learns. Here is an implemenation of GANs:
`# train generator
z = Variable(xp.random.uni... | https://stackoverflow.com/questions/44728913/how-the-generator-is-trained-with-the-output-of-discriminator-in-generative-adve | machine-learning, deep-learning, neural-network, generative-adversarial-network | 1,498,247,146 |
se_78886045 | stackoverflow | MACHINE_LEARNING | Transformer for Reinforcement Learning | Transformer for Reinforcement Learning
I am developing a deep reinforcement learning agent which has a transition and value network. The agent interacts with the environment and from that experience trains the deep learning models like DDQN.
I am using a transformer to model a transition network. I am testing it on bs... | https://stackoverflow.com/questions/78886045/transformer-for-reinforcement-learning | deep-learning, pytorch, reinforcement-learning, transformer-model, sentence-transformers | 1,724,031,089 |
se_36740533 | stackoverflow | MACHINE_LEARNING | What are forward and backward passes in neural networks? | What are forward and backward passes in neural networks?
What is the meaning of forward pass and backward pass in neural networks?
Everybody is mentioning these expressions when talking about backpropagation and epochs.
I understood that forward pass and backward pass together form an epoch. | https://stackoverflow.com/questions/36740533/what-are-forward-and-backward-passes-in-neural-networks | machine-learning, deep-learning, neural-network, conv-neural-network, backpropagation | 1,461,147,019 |
se_42877989 | stackoverflow | MACHINE_LEARNING | What is a loss function in simple words? | What is a loss function in simple words?
Can anyone please explain in simple words and possibly with some examples what is a loss function in the field of machine learning/neural networks?
This came out while I was following a Tensorflow tutorial:
https://www.tensorflow.org/get_started/get_started | https://stackoverflow.com/questions/42877989/what-is-a-loss-function-in-simple-words | tensorflow, machine-learning, deep-learning, neural-network, loss-function | 1,489,860,295 |
se_39092201 | stackoverflow | MACHINE_LEARNING | How does ReLU activation function work in a Neural Network? | How does ReLU activation function work in a Neural Network?
Can anybody tell me how ReLU(Rectified Linear Unit) works?
Theoretically, I get it but I need some demonstration. A simple 2x2 matrix will do. Hope you can help me on this. This is in relation to a Deep Learning course I am taking. | https://stackoverflow.com/questions/39092201/how-does-relu-activation-function-work-in-a-neural-network | machine-learning, deep-learning, neural-network, activation-function, relu | 1,471,925,344 |
se_41269570 | stackoverflow | MACHINE_LEARNING | What is "batch normalizaiton"? why using it? how does it affect prediction? | What is "batch normalizaiton"? why using it? how does it affect prediction?
Recently, many deep architectures use "batch normalization" for training.
What is "batch normalization"? What does it do mathematically? In what way does it help the training process?
How is batch normalization used during training... | https://stackoverflow.com/questions/41269570/what-is-batch-normalizaiton-why-using-it-how-does-it-affect-prediction | machine-learning, neural-network, deep-learning, normalization, caffe | 1,482,345,003 |
se_78908367 | stackoverflow | MACHINE_LEARNING | About tensorflow_hub | About tensorflow_hub
hi guys i'm successfully import tensorflow_hub.
but when I trey to run this code part
"
**IMAGE_SHAPE = (224, 224)
classifier = tf.keras.Sequential([
hub.KerasLayer(classifier_model, input_shape=IMAGE_SHAPE+(3,))**
])"
it generate this error
"------------------------------------------------------... | https://stackoverflow.com/questions/78908367/about-tensorflow-hub | deep-learning, transfer-learning, tensorflow-hub | 1,724,483,505 |
se_71375307 | stackoverflow | MACHINE_LEARNING | Can't retain grad on Tensor that has requires_grad=False, despite specifically setting it to true | Can't retain grad on Tensor that has requires_grad=False, despite specifically setting it to true
I am attempting to create an nn.module in PyTorch, the set_model_params is currently very messy but I'm attempting to set requires_grad to true so I am able to use retain_grad(), but no matter where I'm putting requir... | https://stackoverflow.com/questions/71375307/cant-retain-grad-on-tensor-that-has-requires-grad-false-despite-specifically-s | python, deep-learning, pytorch, gradient, tensor | 1,646,613,048 |
se_61808965 | stackoverflow | MACHINE_LEARNING | PyTorch RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn | PyTorch RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
This code is built up as follows: My robot takes a picture, some tf computer vision model calculates where in the picture the target object starts. This information (x1 and x2 coordinate) is passed to a pytorch model. It shoul... | https://stackoverflow.com/questions/61808965/pytorch-runtimeerror-element-0-of-tensors-does-not-require-grad-and-does-not-ha | python, deep-learning, pytorch, gradient, tensor | 1,589,497,798 |
se_48274929 | stackoverflow | MACHINE_LEARNING | PyTorch - RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed | PyTorch - RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed
I keep running into this error:
RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.... | https://stackoverflow.com/questions/48274929/pytorch-runtimeerror-trying-to-backward-through-the-graph-a-second-time-but | python, deep-learning, pytorch, recurrent-neural-network, autograd | 1,516,082,266 |
se_65344578 | stackoverflow | MACHINE_LEARNING | How to check if a model is in train or eval mode in PyTorch? | How to check if a model is in train or eval mode in PyTorch?
How to check from within a model if it is currently in train or eval mode? | https://stackoverflow.com/questions/65344578/how-to-check-if-a-model-is-in-train-or-eval-mode-in-pytorch | python, machine-learning, deep-learning, pytorch, mode | 1,608,222,454 |
se_78907557 | stackoverflow | MACHINE_LEARNING | YOLOv10 custom training - import YOLO or YOLOv10? | YOLOv10 custom training - import YOLO or YOLOv10?
I wish to apply a custom-training with YoloV10n on a dataset I have (I've been using YoloV8 until now), but I'm not sure wether to use/import YOLO or YOLOv10.
I've initially tried to use YOLOv10, and was able to complete successfully custom training and then inference.... | https://stackoverflow.com/questions/78907557/yolov10-custom-training-import-yolo-or-yolov10 | machine-learning, deep-learning, yolo, ultralytics | 1,724,447,269 |
se_73667338 | stackoverflow | MACHINE_LEARNING | RuntimeError: Could not infer dtype of generator | RuntimeError: Could not infer dtype of generator
I build a training data for a model using PyTorch:
def shufflerow(tensor1, tensor2, axis):
row_perm = torch.rand(tensor1.shape[:axis+1]).argsort(axis) # get permutation indices
for _ in range(tensor1.ndim-axis-1): row_perm.unsqueeze_(-1)
row_perm = row_perm... | https://stackoverflow.com/questions/73667338/runtimeerror-could-not-infer-dtype-of-generator | python, class, deep-learning, pytorch, tensor | 1,662,756,346 |
se_78906991 | stackoverflow | MACHINE_LEARNING | train an NN model independently for different input versions | train an NN model independently for different input versions
I am working with PyTorch to train a neural network model, referred to as 'top_model.' Below, I have outlined my setup, followed by a detailed description of the challenge I am facing.
class torch_top_model(nn.Module):
def __init__(self):
super(t... | https://stackoverflow.com/questions/78906991/train-an-nn-model-independently-for-different-input-versions | optimization, deep-learning, pytorch, neural-network | 1,724,434,242 |
se_52241680 | stackoverflow | MACHINE_LEARNING | PyTorch NotImplementedError in forward | PyTorch NotImplementedError in forward
import torch
import torch.nn as nn
device = torch.device('cuda' if torch.cuda.is_available() else
'cpu')
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.layer = nn.Sequential(
nn.Conv2d(1, 16, kernel_size=3, stride... | https://stackoverflow.com/questions/52241680/pytorch-notimplementederror-in-forward | python, image-processing, deep-learning, computer-vision, pytorch | 1,536,471,714 |
se_61614366 | stackoverflow | MACHINE_LEARNING | Convolutional Autoencoders | Convolutional Autoencoders
I am writing a code for running autoencoder on CIFAR10 dataset and see the reconstructed images.
The requirement is to create
Encoder with First Layer
Input shape: (32,32,3)
Conv2D Layer with 64 Filters of (3,3)
BatchNormalization layer
ReLu activation
2D MaxpoolingLayer with (2,2) filter
... | https://stackoverflow.com/questions/61614366/convolutional-autoencoders | machine-learning, keras, deep-learning, autoencoder | 1,588,685,406 |
se_78900691 | stackoverflow | MACHINE_LEARNING | How to get rid of "PineconeApiException: (400)" and "ValueError: Index 'None' not found in your Pinecone project" in jupyter notebook? | How to get rid of "PineconeApiException: (400)" and "ValueError: Index 'None' not found in your Pinecone project" in jupyter notebook?
I am using this link to learn langhain and pinecone. Just copy pasted the code as bellow:
I am using default PINECONE_API_KEY and using bellow code I am abl... | https://stackoverflow.com/questions/78900691/how-to-get-rid-of-pineconeapiexception-400-and-valueerror-index-none-no | machine-learning, deep-learning, langchain, generative-adversarial-network, pinecone | 1,724,317,662 |
se_78901998 | stackoverflow | MACHINE_LEARNING | How does OpenAIEmbeddings() work? Is it creating a single vector of size 1536 for whole text corpus? | How does OpenAIEmbeddings() work? Is it creating a single vector of size 1536 for whole text corpus?
I'm working with the OpenAIEmbeddings() class from OpenAI, which uses the text-embedding-3-small model. According to the documentation, it generates a 1536-dimensional vector for any input text.
However, I'm a bit conf... | https://stackoverflow.com/questions/78901998/how-does-openaiembeddings-work-is-it-creating-a-single-vector-of-size-1536-fo | deep-learning, nlp, openai-api, openaiembeddings | 1,724,335,765 |
se_71942290 | stackoverflow | MACHINE_LEARNING | Anomaly detection with GAN | Anomaly detection with GAN
There's something about GAN's training that i don't understand. I am making a GAN for Anomaly Detection. To start I followed this guide here to create a DCGAN (and understand how it works) and then move into the Anomaly Detection stuff.
I understand how the two training's phases work for GAN... | https://stackoverflow.com/questions/71942290/anomaly-detection-with-gan | deep-learning, generative-adversarial-network, anomaly-detection | 1,650,468,245 |
se_78898892 | stackoverflow | MACHINE_LEARNING | Tensorflow model still trains even with training=False | Tensorflow model still trains even with training=False
Simple code to reproduce follows
import tensorflow as tf
import tensorflow.keras as keras
inp = keras.Input((3, 3))
layer = keras.layers.Dense(1)
tar = layer(inp)
tar2 = layer(inp, training=False)
model2 = keras.Model(inp, tar2)
model2.compile(loss='mse', optimi... | https://stackoverflow.com/questions/78898892/tensorflow-model-still-trains-even-with-training-false | tensorflow, machine-learning, keras, deep-learning | 1,724,272,112 |
se_78894076 | stackoverflow | MACHINE_LEARNING | How capture the error value for each epoch in MATLAB? | How capture the error value for each epoch in MATLAB?
everyone!
I'm having a problem regarding my Deep Learning project, in the image regression task, and I would like to know how I could obtain the RMSE value at each epoch of my model's execution, and export in a .xlsx archive.
rmseValues = zeros(numEpochs, 1);
for e... | https://stackoverflow.com/questions/78894076/how-capture-the-error-value-for-each-epoch-in-matlab | matlab, deep-learning, training-data | 1,724,180,768 |
se_72297600 | stackoverflow | MACHINE_LEARNING | Text extraction and text recognition with AI | Text extraction and text recognition with AI
Starting from text I'd like to be able to identify specific informations.
Example :
Input texts : "The invoice number is 18", "Inv : 75", "Inv N. : 84"
Identified invoice numbers : "18", "75", "84"
The concrete problem is I have a lot of documents containing lots of this in... | https://stackoverflow.com/questions/72297600/text-extraction-and-text-recognition-with-ai | python, machine-learning, deep-learning | 1,652,922,954 |
se_78882799 | stackoverflow | MACHINE_LEARNING | Layer count mismatch when loading weights from file transfer learning in keras | Layer count mismatch when loading weights from file transfer learning in keras
I'm new to convolutional neural network and machine learning in general, so sorry in advance if my question is really straighforward, but I have searched for a while without getting a solution to fix it. For a semantic segmentation task, I ... | https://stackoverflow.com/questions/78882799/layer-count-mismatch-when-loading-weights-from-file-transfer-learning-in-keras | python, keras, deep-learning, transfer-learning | 1,723,913,511 |
se_78896156 | stackoverflow | MACHINE_LEARNING | validation loss improvement in ConvLSTM model for prediction of ASL Images | validation loss improvement in ConvLSTM model for prediction of ASL Images
I have been trying to build a convLSTM model for classifying ASL images into 1 of the given 29 classes in the dataset. The dataset I am using is this - https://www.kaggle.com/datasets/debashishsau/aslamerican-sign-language-aplhabet-dataset/data... | https://stackoverflow.com/questions/78896156/validation-loss-improvement-in-convlstm-model-for-prediction-of-asl-images | python, deep-learning, conv-neural-network, lstm, image-classification | 1,724,232,452 |
se_78429387 | stackoverflow | MACHINE_LEARNING | ValueError: Unable to synchronously create dataset (name already exists) | ValueError: Unable to synchronously create dataset (name already exists)
When I tried to save the model as h5
caption_model.save("/kaggle/working/mymodel.h5")
This erorr appeared to me
ValueError Traceback (most recent call last)
Cell In[19], line 1
----> 1 caption_model.save("/kaggle/w... | https://stackoverflow.com/questions/78429387/valueerror-unable-to-synchronously-create-dataset-name-already-exists | python, machine-learning, keras, deep-learning, h5py | 1,714,834,293 |
se_77624572 | stackoverflow | MACHINE_LEARNING | RuntimeError: CUDA error: out of memory - CUDA Memory occurred at the validation stage | RuntimeError: CUDA error: out of memory - CUDA Memory occurred at the validation stage
I have the problem "CUDA error: out of memory" when my Deep Learning model runs validation. Although previously in the training stage, forward and backprop stages - which should have taken up a lot of memory with many saved gradient... | https://stackoverflow.com/questions/77624572/runtimeerror-cuda-error-out-of-memory-cuda-memory-occurred-at-the-validation | python, deep-learning, pytorch | 1,702,014,505 |
se_51143206 | stackoverflow | MACHINE_LEARNING | `permute()` vs `view()` in PyTorch? | `permute()` vs `view()` in PyTorch?
What is the difference between tensor.permute() and tensor.view()?
They seem to do the same thing. | https://stackoverflow.com/questions/51143206/permute-vs-view-in-pytorch | python, multidimensional-array, deep-learning, pytorch, tensor | 1,530,562,723 |
se_75274241 | stackoverflow | MACHINE_LEARNING | t() expects a tensor with <= 2 dimensions, but self is 3D | t() expects a tensor with <= 2 dimensions, but self is 3D
I'm new to PyTorch and wrote a simple code as following to classify some inputs. The model input has 8*2 with batch size of 2 and the input layer in the model has 2 nodes. I don't know what is wrong!
X1=np.array([[2,1],[3,2],[-4,-1],[-1,-3],[2,-1],[3,-3],[-2... | https://stackoverflow.com/questions/75274241/t-expects-a-tensor-with-2-dimensions-but-self-is-3d | python, machine-learning, deep-learning, pytorch, runtime-error | 1,674,988,686 |
se_78894382 | stackoverflow | MACHINE_LEARNING | How to convert polygon points in a XML file to TFRecord format? | How to convert polygon points in a XML file to TFRecord format?
I am currently using a Python script to convert XML files containing object annotations into TFRecord files, which are necessary for training object detection models like Faster R-CNN in TensorFlow. However, the script I’m using is only set up to handle b... | https://stackoverflow.com/questions/78894382/how-to-convert-polygon-points-in-a-xml-file-to-tfrecord-format | python, xml, tensorflow, deep-learning, tfrecord | 1,724,187,509 |
se_78370048 | stackoverflow | MACHINE_LEARNING | tensorflow federated error module 'tensorflow_federated.python.learning' has no attribute 'build_federated_averaging_process' | tensorflow federated error module 'tensorflow_federated.python.learning' has no attribute 'build_federated_averaging_process'
I have a ML code
import pandas as pd
import numpy as np
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing im... | https://stackoverflow.com/questions/78370048/tensorflow-federated-error-module-tensorflow-federated-python-learning-has-no | tensorflow, machine-learning, deep-learning, tensorflow-federated | 1,713,850,255 |
se_37674306 | stackoverflow | MACHINE_LEARNING | What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow? | What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow?
What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow?
In my opinion, 'VALID' means there will be no zero padding outside the edges when we do max pool.
According to A guide... | https://stackoverflow.com/questions/37674306/what-is-the-difference-between-same-and-valid-padding-in-tf-nn-max-pool-of-t | python, tensorflow, deep-learning | 1,465,288,336 |
se_78891901 | stackoverflow | MACHINE_LEARNING | Loading partial weights of a neural network | Loading partial weights of a neural network
I'm working on a Deep Learning project where I'm adding, on a pre-trained Wide ResNet a couple of linear layers after that, and another technique that I'm using.
My question is if I construct the Network where I add the layers and the techniques that I'm using to the broad r... | https://stackoverflow.com/questions/78891901/loading-partial-weights-of-a-neural-network | python, performance, machine-learning, deep-learning, pytorch | 1,724,149,592 |
se_77094149 | stackoverflow | MACHINE_LEARNING | How to use both gpus in kaggle for training in pytorch? | How to use both gpus in kaggle for training in pytorch?
I was training a model in kaggle gpu.
But as I can see only one GPU is working.
I use the ordinary method for training like
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
model = model.to(device)
How can I use both the gpus? | https://stackoverflow.com/questions/77094149/how-to-use-both-gpus-in-kaggle-for-training-in-pytorch | machine-learning, deep-learning, nlp, gpu, kaggle | 1,694,580,984 |
se_72506050 | stackoverflow | MACHINE_LEARNING | Ran into "TypeError: '<' not supported between instances of 'Tensor' and 'list'" when going through dataset | Ran into "TypeError: '<' not supported between instances of 'Tensor' and 'list'" when going through dataset
I am replicating ResNet (source: https://arxiv.org/abs/1512.03385).
I ran into the error "TypeError: '<' not supported between instances of 'Tensor' and 'list'" when trying t... | https://stackoverflow.com/questions/72506050/ran-into-typeerror-not-supported-between-instances-of-tensor-and-list | python, machine-learning, deep-learning, dataset, resnet | 1,654,420,029 |
se_71166789 | stackoverflow | MACHINE_LEARNING | HuggingFace: ValueError: expected sequence of length 165 at dim 1 (got 128) | HuggingFace: ValueError: expected sequence of length 165 at dim 1 (got 128)
I am trying to fine-tune the BERT language model on my own data. I've gone through their docs, but their tasks seem to be not quite what I need, since my end goal is embedding text. Here's my code:
from datasets import load_dataset
from transf... | https://stackoverflow.com/questions/71166789/huggingface-valueerror-expected-sequence-of-length-165-at-dim-1-got-128 | python, deep-learning, pytorch, huggingface-transformers, bert-language-model | 1,645,141,530 |
se_78872941 | stackoverflow | MACHINE_LEARNING | Error when launching DLC 3.0.0rc4 environment Deeplabcut Windows 11 | Error when launching DLC 3.0.0rc4 environment Deeplabcut Windows 11
I am trying to create the deeplabcut environment on windows 11 on version 3.0.0rc4 on python 3.10.14, tensorflow = 2.10. I am using a local GPU. It will successfully create the environment, but it fails to launch.
Here is the code I used to install th... | https://stackoverflow.com/questions/78872941/error-when-launching-dlc-3-0-0rc4-environment-deeplabcut-windows-11 | python, deep-learning, anaconda | 1,723,670,075 |
se_78887768 | stackoverflow | MACHINE_LEARNING | Handling Non-Exact Division in Batch Size For Datasets in CNN | Handling Non-Exact Division in Batch Size For Datasets in CNN
I'm working on a CNN project and need some help with adjusting the steps and batch parameters. Here's a summary of my dataset:
Training images: 5360
Validation images: 1151
Test images: 1147
I have set the following parameters:
Epochs: 20
Batch size: 16
T... | https://stackoverflow.com/questions/78887768/handling-non-exact-division-in-batch-size-for-datasets-in-cnn | python, tensorflow, machine-learning, keras, deep-learning | 1,724,068,430 |
se_78631488 | stackoverflow | MACHINE_LEARNING | AttributeError: 'NoneType' object has no attribute 'items' when training DL dataset made using 'ImageDataGenerator' | AttributeError: 'NoneType' object has no attribute 'items' when training DL dataset made using 'ImageDataGenerator'
I am trying to train a resnet50 model using transfer learning and a dataset containing 40,000 images.
I used ImageDataGenerator to prepare the dataset and then used flow_from_dire... | https://stackoverflow.com/questions/78631488/attributeerror-nonetype-object-has-no-attribute-items-when-training-dl-data | python-3.x, deep-learning, resnet, image-classification, imagedatagenerator | 1,718,611,379 |
se_78886512 | stackoverflow | MACHINE_LEARNING | OutOfMemoryError: CUDA out of memory while using compute_metrics function in Hugging Face Trainer | OutOfMemoryError: CUDA out of memory while using compute_metrics function in Hugging Face Trainer
I'm encountering a CUDA out of memory error when using the compute_metrics function with the Hugging Face Trainer during model evaluation. My GPU is running out of memory while trying to compute the ROUGE scores. Below is... | https://stackoverflow.com/questions/78886512/outofmemoryerror-cuda-out-of-memory-while-using-compute-metrics-function-in-hug | python, deep-learning, pytorch, huggingface-transformers, huggingface | 1,724,048,157 |
se_70279287 | stackoverflow | MACHINE_LEARNING | RuntimeError: expected scalar type Long but found Float (Pytorch) | RuntimeError: expected scalar type Long but found Float (Pytorch)
I've tried many times to fix, also I've used the example codes from functional.py then I got my same "loss" value. How can I fix this?
My libraries:
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import numpy as np
import matplotlib... | https://stackoverflow.com/questions/70279287/runtimeerror-expected-scalar-type-long-but-found-float-pytorch | python, machine-learning, deep-learning, pytorch, artificial-intelligence | 1,638,984,551 |
se_78885387 | stackoverflow | MACHINE_LEARNING | Why do the supposed super resolution images from SRGAN appear in RGB colors? | Why do the supposed super resolution images from SRGAN appear in RGB colors?
I am using this srgan script to try to generate super resolution satellite images. A few things I modified are input images, shapes and saving images. Anyone understands why the images generated looks like: this.
Also, why are the rgb pixels ... | https://stackoverflow.com/questions/78885387/why-do-the-supposed-super-resolution-images-from-srgan-appear-in-rgb-colors | deep-learning, generative-adversarial-network, satellite-image | 1,724,005,965 |
se_43656736 | stackoverflow | MACHINE_LEARNING | What is `Tensor` and how is it different from a vector? | What is `Tensor` and how is it different from a vector?
I am beginner in machine learning and I am facing this question. Please provide me the simple example or content so that I can understand it in the best way. | https://stackoverflow.com/questions/43656736/what-is-tensor-and-how-is-it-different-from-a-vector | machine-learning, math, deep-learning, tensor, terminology | 1,493,293,242 |
se_49006773 | stackoverflow | MACHINE_LEARNING | UserWarning: Implicit dimension choice for log_softmax has been deprecated | UserWarning: Implicit dimension choice for log_softmax has been deprecated
I´m using Mac OS el capitán and I am trying to follow the quick start tutorial for OpenNMT pytorch version. In the training step I get the following warning message:
OpenNMT-py/onmt/modules/GlobalAttention.py:177: UserWarning: Implicit dimens... | https://stackoverflow.com/questions/49006773/userwarning-implicit-dimension-choice-for-log-softmax-has-been-deprecated | python-3.x, macos, deep-learning, pytorch, opennmt | 1,519,728,339 |
se_72061934 | stackoverflow | MACHINE_LEARNING | UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])) | UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1]))
I have this code:
actual_loes_score_g = actual_loes_score_t.to(self.device, non_blocking=True)
predicted_loes_score_g = self.model(input_g)
loss_func = nn.L1Loss()
loss_g = loss_func(
predicted_loes_score_... | https://stackoverflow.com/questions/72061934/userwarning-using-a-target-size-torch-size1-that-is-different-to-the-inpu | machine-learning, deep-learning, pytorch, loss-function, user-warning | 1,651,254,627 |
se_76034630 | stackoverflow | MACHINE_LEARNING | How do I send an attention-mask "Mask" matrix in transformer encoder along with my latent in pytorch's nn.TransformerEncoder? | How do I send an attention-mask "Mask" matrix in transformer encoder along with my latent in pytorch's nn.TransformerEncoder?
I have a transformer_encoder initialized in pytorch as:
transformer_encoder = nn.TransformerEncoder(nn.TransformerEncoderLayer(d_model=input_dim, nhead=num_heads), num_layers=num_... | https://stackoverflow.com/questions/76034630/how-do-i-send-an-attention-mask-mask-matrix-in-transformer-encoder-along-with | python, machine-learning, deep-learning, pytorch, transformer-model | 1,681,730,663 |
se_60873477 | stackoverflow | MACHINE_LEARNING | IndexError: tensors used as indices must be long, byte or bool tensors | IndexError: tensors used as indices must be long, byte or bool tensors
I am getting this error only during the testing phase, but I do not face any problem in the training and validation phase.
IndexError: tensors used as indices must be long, byte or bool tensors
I get this error for the last line in the given cod... | https://stackoverflow.com/questions/60873477/indexerror-tensors-used-as-indices-must-be-long-byte-or-bool-tensors | python, list, image, deep-learning, pytorch | 1,585,245,820 |
se_78882007 | stackoverflow | MACHINE_LEARNING | Differences Between Human Pose Estimation and Facial Landmark Models in Structure | Differences Between Human Pose Estimation and Facial Landmark Models in Structure
I have a question regarding the structural differences between human pose estimation models and facial landmark models. While I understand that both models aim to predict keypoints, I wonder how the structure of these models might differ... | https://stackoverflow.com/questions/78882007/differences-between-human-pose-estimation-and-facial-landmark-models-in-structur | deep-learning, yolo | 1,723,891,417 |
se_78858484 | stackoverflow | MACHINE_LEARNING | Epoch 1/3 ^C - model.fit() was terminated with this line and without any error | Epoch 1/3 ^C - model.fit() was terminated with this line and without any error
I'm developing a U_Net Model for Segmentation. My Train dataset shape is
[{'image', [32, 128, 128, 2]}; {'detection', [32, 128, 128, 2]}]
such that { 'image', [number of MRI slices, height, width, len(['T2W', 'ADC'])] } { 'detection... | https://stackoverflow.com/questions/78858484/epoch-1-3-c-model-fit-was-terminated-with-this-line-and-without-any-error | python, tensorflow, machine-learning, keras, deep-learning | 1,723,384,056 |
se_78877718 | stackoverflow | MACHINE_LEARNING | Why does VGG trained from scratch throw an error when input channes are changed to more than three? | Why does VGG trained from scratch throw an error when input channes are changed to more than three?
Using this guide on how to implemenent VGG19 from scratch, I changed the input shape but gives error. How do I modify this layer to accept images with more than 3 channels?
Changed from:
input_shape = (224,224,3)
to:
i... | https://stackoverflow.com/questions/78877718/why-does-vgg-trained-from-scratch-throw-an-error-when-input-channes-are-changed | deep-learning, vgg-net | 1,723,786,391 |
se_78151471 | stackoverflow | MACHINE_LEARNING | Neural Style Transfer Unsatisfactory Results | Neural Style Transfer Unsatisfactory Results
I am trying to use neural style transfer(NST) to visualize the results of remodelling of a home's interiors and how it will look as per the user's style image. While the code I use gives me good results most of the time, it occasionally gives me noisy and irrelevant results... | https://stackoverflow.com/questions/78151471/neural-style-transfer-unsatisfactory-results | image, deep-learning, pytorch, neural-network, style-transfer | 1,710,308,585 |
se_76467033 | stackoverflow | MACHINE_LEARNING | Audio classification in Android for an audio clip as input (using YAMNet TensorFlow lite model) | Audio classification in Android for an audio clip as input (using YAMNet TensorFlow lite model)
I've used this audio classification app and I really like it:
https://github.com/tensorflow/examples/tree/master/lite/examples/audio_classification/android/
This example use a phone mic to start recording (live recording) a... | https://stackoverflow.com/questions/76467033/audio-classification-in-android-for-an-audio-clip-as-input-using-yamnet-tensorf | android, audio, deep-learning, tensorflow-lite | 1,686,674,324 |
se_78443363 | stackoverflow | MACHINE_LEARNING | Error while loading MISTRAL LLM for fine-tune. Qlora doesn't work but full works | Error while loading MISTRAL LLM for fine-tune. Qlora doesn't work but full works
if I try to load the model in this way :
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True)
model = AutoModelForCausalLM.from_pretrained(
"mistralai/Mistr... | https://stackoverflow.com/questions/78443363/error-while-loading-mistral-llm-for-fine-tune-qlora-doesnt-work-but-full-works | deep-learning, large-language-model, fine-tuning, mistral-7b | 1,715,093,452 |
se_59864408 | stackoverflow | MACHINE_LEARNING | tensorflow:Your input ran out of data | tensorflow:Your input ran out of data
I am working on a seq2seq keras/tensorflow 2.0 model. Every time the user inputs something, my model prints the response perfectly fine. However on the last line of each response I get this:
You: WARNING:tensorflow:Your input ran out of data; interrupting training. Make sure that... | https://stackoverflow.com/questions/59864408/tensorflowyour-input-ran-out-of-data | python, tensorflow, machine-learning, keras, deep-learning | 1,579,711,242 |
se_78872601 | stackoverflow | MACHINE_LEARNING | Sample weights for loss computing by huggingface transformer model | Sample weights for loss computing by huggingface transformer model
I'm training a GPT2LMHeadModel in Python using huggingface's transformers library. The task is next token prediction. If I understand correctly, if this object is provided a labels argument, it should automatically compute loss for each pair of tokens,... | https://stackoverflow.com/questions/78872601/sample-weights-for-loss-computing-by-huggingface-transformer-model | python, deep-learning, pytorch, huggingface-transformers, language-model | 1,723,662,863 |
se_78871831 | stackoverflow | MACHINE_LEARNING | Multi loss going into the same subsquent model using PyTorch | Multi loss going into the same subsquent model using PyTorch
I am currently facing a problem.
I am wondering how I should back propagate the loss functions in the following model.
What is important here is that all the blue part is common to the 2 outputs, the green part is a binary classification using BCELoss and th... | https://stackoverflow.com/questions/78871831/multi-loss-going-into-the-same-subsquent-model-using-pytorch | python, deep-learning, pytorch, loss-function | 1,723,650,068 |
se_78868722 | stackoverflow | MACHINE_LEARNING | output of custom attention mechanism implementation does not match torch.nn.MultiheadAttention | output of custom attention mechanism implementation does not match torch.nn.MultiheadAttention
I was trying to create my own attention function for a project I'm working on. However, when I compared the output and weights from my code with those from torch.nn.MultiheadAttention, I noticed that the softmax(QK^T/d_k^0.5... | https://stackoverflow.com/questions/78868722/output-of-custom-attention-mechanism-implementation-does-not-match-torch-nn-mult | deep-learning, pytorch, attention-model | 1,723,596,348 |
se_78870533 | stackoverflow | MACHINE_LEARNING | Issues trying to load saved Keras U-Net model from h5 file | Issues trying to load saved Keras U-Net model from h5 file
I've been assigned a task in my company to try to hydrate a model that was trained for a previous project, and while I can load it again, I'm failing to try it and I don't know why.
The model follows a U-Net architecture, and here's the output of the summary()... | https://stackoverflow.com/questions/78870533/issues-trying-to-load-saved-keras-u-net-model-from-h5-file | python, tensorflow, keras, deep-learning, unet-neural-network | 1,723,632,737 |
se_78869378 | stackoverflow | MACHINE_LEARNING | Generator is not learning in One to Many CGANs | Generator is not learning in One to Many CGANs
I am still new to GANs and trying to implement the One to Many CGAN, on the MNIST Dataset, to generate a sequence of images (with the number of output images equal to the number of generators) from a sum. For example, A 4-generators 1-discriminator CGANS model will genera... | https://stackoverflow.com/questions/78869378/generator-is-not-learning-in-one-to-many-cgans | deep-learning, one-to-many, mnist, generative-adversarial-network, cgan | 1,723,615,956 |
se_78860154 | stackoverflow | MACHINE_LEARNING | Why YOLOv8 detects bunch of random objects | Why YOLOv8 detects bunch of random objects
I'm using the YOLOv8 command-line interface (CLI) to run object detection on an image, but I'm getting unexpected results. The model seems to be detecting a bunch of random objects that aren't present in the image.
Here’s the command I'm using:
yolo predict model=yolov8n.pt s... | https://stackoverflow.com/questions/78860154/why-yolov8-detects-bunch-of-random-objects | machine-learning, deep-learning, object-detection, yolo, yolov8 | 1,723,442,308 |
se_78195501 | stackoverflow | MACHINE_LEARNING | Can utilising Numpy functions inside the TensorFlow pipeline lead to memory leaks? | Can utilising Numpy functions inside the TensorFlow pipeline lead to memory leaks?
While training models in a loop using TensorFlow 2.14, the GPU RAM in use gradually increases until it reaches a maximum value at some iteration, at which point the process is killed.
So far, I've tried many solutions I've found (such a... | https://stackoverflow.com/questions/78195501/can-utilising-numpy-functions-inside-the-tensorflow-pipeline-lead-to-memory-leak | python, tensorflow, deep-learning, memory-leaks, out-of-memory | 1,710,958,465 |
se_78862667 | stackoverflow | MACHINE_LEARNING | pytorch - RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0 | pytorch - RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0
When I come accross kuangliu's github repo on training cifar-10 with densenet model, I want to feed the model to the gpu to accelerate the training process. However, it seems like the input tensor is f... | https://stackoverflow.com/questions/78862667/pytorch-runtimeerror-expected-all-tensors-to-be-on-the-same-device-but-found | python, deep-learning, pytorch, densenet | 1,723,479,740 |
se_78860233 | stackoverflow | MACHINE_LEARNING | Using ResNet50 to create a feature tensor of [w, h, f] | Using ResNet50 to create a feature tensor of [w, h, f]
I'm trying to implement this paper but I'm not following something in it.
It wants me to use ResNet50 to extract features from an image but tells me the extracted features will be of dimension [w, h, f]. Everything I'm seeing with ResNet50, though, is giving me ba... | https://stackoverflow.com/questions/78860233/using-resnet50-to-create-a-feature-tensor-of-w-h-f | machine-learning, deep-learning, pytorch, ocr, resnet | 1,723,444,023 |
se_51480521 | stackoverflow | MACHINE_LEARNING | ValueError: Cannot use the given session to evaluate tensor: the tensor's graph is different from the session's graph | ValueError: Cannot use the given session to evaluate tensor: the tensor's graph is different from the session's graph
I want to use tensorflow model in ROS. And this code can work. However, it is very slow because of everytime it restore the model.
class image_converter:
def __init__(self):
self.demo_pub =... | https://stackoverflow.com/questions/51480521/valueerror-cannot-use-the-given-session-to-evaluate-tensor-the-tensors-graph | python, tensorflow, deep-learning, ros | 1,532,354,020 |
se_50544730 | stackoverflow | MACHINE_LEARNING | How do I split a custom dataset into training and test datasets? | How do I split a custom dataset into training and test datasets?
import pandas as pd
import numpy as np
import cv2
from torch.utils.data.dataset import Dataset
class CustomDatasetFromCSV(Dataset):
def __init__(self, csv_path, transform=None):
self.data = pd.read_csv(csv_path)
self.labels = pd.get_... | https://stackoverflow.com/questions/50544730/how-do-i-split-a-custom-dataset-into-training-and-test-datasets | python, deep-learning, pytorch | 1,527,351,364 |
se_55581553 | stackoverflow | MACHINE_LEARNING | Tensorflow inference run time high on first data point, decreases on subsequent data points | Tensorflow inference run time high on first data point, decreases on subsequent data points
I am running inference using one of the models from TensorFlow's object detection module. I'm looping over my test images in the same session and doing sess.run(). However, on profiling these runs, I realize the first run alway... | https://stackoverflow.com/questions/55581553/tensorflow-inference-run-time-high-on-first-data-point-decreases-on-subsequent | tensorflow, deep-learning, object-detection, object-detection-api, pre-trained-model | 1,554,756,595 |
se_54716377 | stackoverflow | MACHINE_LEARNING | How to do gradient clipping in pytorch? | How to do gradient clipping in pytorch?
What is the correct way to perform gradient clipping in pytorch?
I have an exploding gradients problem. | https://stackoverflow.com/questions/54716377/how-to-do-gradient-clipping-in-pytorch | python, machine-learning, deep-learning, pytorch, gradient-descent | 1,550,261,384 |
se_78848428 | stackoverflow | MACHINE_LEARNING | My model would not train, because of the loss function | My model would not train, because of the loss function
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-37-9a9cd8046c6f> in <cell line: 18>()
16 loss=tf.keras.losses.CategoricalCross... | https://stackoverflow.com/questions/78848428/my-model-would-not-train-because-of-the-loss-function | python, tensorflow, machine-learning, keras, deep-learning | 1,723,120,194 |
se_78210721 | stackoverflow | MACHINE_LEARNING | MLR3 training error with Deepsurv (deephit works fine) | MLR3 training error with Deepsurv (deephit works fine)
My code was running just fine with an 80/20 training test split. For own reasons, I want to test out performance at 70/30 split but DeepSurv is giving an error. Although no errors before, and other deep survival models are running on both data splits (Deephit and ... | https://stackoverflow.com/questions/78210721/mlr3-training-error-with-deepsurv-deephit-works-fine | deep-learning, survival-analysis, survival, mlr3, mlr3proba | 1,711,194,345 |
se_78816835 | stackoverflow | MACHINE_LEARNING | How to Apply Image Augmentations in TensorFlow Pipeline for Large Dataset? | How to Apply Image Augmentations in TensorFlow Pipeline for Large Dataset?
I have a dataset of images, each containing a 1 to 5letter word. I want to use deep learning to classify the characters that make up the word in each image. The labels for these images are formatted as follows:
totalcharacter_indexoffirstchar_i... | https://stackoverflow.com/questions/78816835/how-to-apply-image-augmentations-in-tensorflow-pipeline-for-large-dataset | python, tensorflow, machine-learning, deep-learning, data-augmentation | 1,722,435,061 |
se_78841275 | stackoverflow | MACHINE_LEARNING | What are Tokens, Top K and Top P? | What are Tokens, Top K and Top P?
I'm learning to use Google AI Studio and when generating the snippet I came across these terms:
const generationConfig = {
temperature: 1,
topP: 0.95,
topK: 64,
maxOutputTokens: 8192,
responseMimeType: "text/plain",
};
I'm struggling to understand what those terms mean. Wha... | https://stackoverflow.com/questions/78841275/what-are-tokens-top-k-and-top-p | machine-learning, deep-learning, artificial-intelligence, google-gemini | 1,722,984,928 |
se_78843066 | stackoverflow | MACHINE_LEARNING | Keep getting the error: "ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concatenation axis" | Keep getting the error: "ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concatenation axis"
I've tried to implement a U-Net model to classify audio, and after preprocessing, I've converted the data into a dataset of float values. These are the shapes of my X and Y
X_tra... | https://stackoverflow.com/questions/78843066/keep-getting-the-error-valueerror-a-concatenate-layer-requires-inputs-with | numpy, multidimensional-array, deep-learning, conv-neural-network, unet-neural-network | 1,723,025,065 |
se_62726792 | stackoverflow | MACHINE_LEARNING | Pytorch: RuntimeError: expected dtype Float but got dtype Long | Pytorch: RuntimeError: expected dtype Float but got dtype Long
I encounter this weird error when building a simple NN in Pytorch. I dont understand this error and why this consern Long and Float datatype in backward function. Anyone encounter this before? Thanks for any help.
Traceback (most recent call last):
File ... | https://stackoverflow.com/questions/62726792/pytorch-runtimeerror-expected-dtype-float-but-got-dtype-long | python, deep-learning, pytorch, backpropagation | 1,593,850,015 |
se_73217530 | stackoverflow | MACHINE_LEARNING | Extract the masks values from detectron2 object detection Segmentation and then draw the mask with opencv and calculate the area of that mask? | Extract the masks values from detectron2 object detection Segmentation and then draw the mask with opencv and calculate the area of that mask?
I want to calculate the area of predicted masks from the output of Detectron2 object detection Segmentation
So when I run inference it returns the dictionary
outputs = predicto... | https://stackoverflow.com/questions/73217530/extract-the-masks-values-from-detectron2-object-detection-segmentation-and-then | opencv, deep-learning, computer-vision, image-segmentation, detectron | 1,659,510,112 |
se_78831225 | stackoverflow | MACHINE_LEARNING | Model to generate 512x512 photos | Model to generate 512x512 photos
how can I make this model generate 512x512 px images or bigger? Now it generates 64x64px images.I tried changing some values in the model but it didn't work. And how these convolutional layers work especially Conv2D and Conv2DTranspose? I don't understand how the image is resized in th... | https://stackoverflow.com/questions/78831225/model-to-generate-512x512-photos | python, tensorflow, machine-learning, deep-learning, generative-adversarial-network | 1,722,778,943 |
se_78831904 | stackoverflow | MACHINE_LEARNING | Complex state in re-inforcement learning | Complex state in re-inforcement learning
In an RL code, the states are complex numbers. I pass it to the actor function, whose code is as follows:
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super(Actor, self).__init__()
hidden_dim = 1 if state_dim == 0 else 2 **... | https://stackoverflow.com/questions/78831904/complex-state-in-re-inforcement-learning | deep-learning, state, reinforcement-learning, actor, ddpg | 1,722,798,459 |
se_78830871 | stackoverflow | MACHINE_LEARNING | Dimension Error in MobileNet SSD object detection | Dimension Error in MobileNet SSD object detection
I am trying to implement an object detection algorithm using ssd_mobilenet_v2_fpnlite_320x320 using Tensorflow Object Detection API. My input image is of size 1024x33. But when I run the training script it gave the error like
ValueError: Dimensions must be equal, but a... | https://stackoverflow.com/questions/78830871/dimension-error-in-mobilenet-ssd-object-detection | tensorflow, deep-learning, object-detection, object-detection-api, mobilenet | 1,722,769,024 |
se_78823685 | stackoverflow | MACHINE_LEARNING | How to apply class weights to using Pytorch's CrossEntropyLoss to solve an imbalanced data classification problem for Multi-class Multi-output problem | How to apply class weights to using Pytorch's CrossEntropyLoss to solve an imbalanced data classification problem for Multi-class Multi-output problem
I'm trying to use a weighted loss function to handle class imbalance in my data. My problem is a multi-class and multi-output problem. For example (my data has five... | https://stackoverflow.com/questions/78823685/how-to-apply-class-weights-to-using-pytorchs-crossentropyloss-to-solve-an-imbal | python, machine-learning, deep-learning, pytorch | 1,722,569,695 |
se_76865944 | stackoverflow | MACHINE_LEARNING | plot the Training-Losses with the time series library "Darts" | plot the Training-Losses with the time series library "Darts"
Is there a way to plot the Training-Losses from a model, which is trained with the time series library "Darts"? i am working with RNNs from the Darts-library for TimeSeries Forecasting. i am wondering, if there is a way to plot the training losses... | https://stackoverflow.com/questions/76865944/plot-the-training-losses-with-the-time-series-library-darts | tensorflow, deep-learning, time-series, forecasting, u8darts | 1,691,570,058 |
se_78779554 | stackoverflow | MACHINE_LEARNING | Why does a conditional VAE not ignore the condition? | Why does a conditional VAE not ignore the condition?
A variational autoencoder optimizes the ELBo objective:
In no way is ELBo based on a joint or factorized probability distribution of two variables x and y. Therefore, the encoder of a conditional VAE seems to be able to ignore y (the condition) entirely, and merely... | https://stackoverflow.com/questions/78779554/why-does-a-conditional-vae-not-ignore-the-condition | deep-learning, log-likelihood | 1,721,662,175 |
se_78822989 | stackoverflow | MACHINE_LEARNING | RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) | RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor)
I am trying to implement CUDA for this graph neural network model "https://github.com/VincLee8188/GMAN-PyTorch" to use the nvidia GPU to be able to speed up the process since with the CPU it takes about 10 hours, all this I am using ... | https://stackoverflow.com/questions/78822989/runtimeerror-input-type-torch-floattensor-and-weight-type-torch-cuda-floatte | python, graph, deep-learning, pytorch | 1,722,545,146 |
se_78826862 | stackoverflow | MACHINE_LEARNING | for deep learning: save each sample individually or keep blocks? data doesnt fit memory | for deep learning: save each sample individually or keep blocks? data doesnt fit memory
I am training a classifier. My data comes from multiple datasets, each dataset contains multiple subjects, each subject has performed multiple trials. Currently my data structure on disk looks like this:
-dataset1_subject1.pt
-data... | https://stackoverflow.com/questions/78826862/for-deep-learning-save-each-sample-individually-or-keep-blocks-data-doesnt-fit | python, deep-learning, pytorch, data-wrangling | 1,722,624,773 |
se_75501048 | stackoverflow | MACHINE_LEARNING | How to fix AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import) | How to fix AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import)
when i import TensorFlow GPU I get this error
AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due ... | https://stackoverflow.com/questions/75501048/how-to-fix-attributeerror-partially-initialized-module-charset-normalizer-has | tensorflow, deep-learning | 1,676,818,988 |
se_46654424 | stackoverflow | MACHINE_LEARNING | How to calculate optimal batch size? | How to calculate optimal batch size?
Sometimes I run into a problem:
OOM when allocating tensor with shape
e.g.
OOM when allocating tensor with shape (1024, 100, 160)
Where 1024 is my batch size and I don't know what's the rest. If I reduce the batch size or the number of neurons in the model, it runs fine.
Is there... | https://stackoverflow.com/questions/46654424/how-to-calculate-optimal-batch-size | machine-learning, neural-network, deep-learning, keras, gradient-descent | 1,507,580,709 |
se_78811507 | stackoverflow | MACHINE_LEARNING | Tensorflow Object Detection API installation issues | Tensorflow Object Detection API installation issues
I am trying to install tensorflow object detection API using this link in my Ubuntu PC.
My goal is to use MobileNet SSD for object detection.
My tensorflow version is 2.13.1. I was able to install the object detection API by following this link. But when I run a samp... | https://stackoverflow.com/questions/78811507/tensorflow-object-detection-api-installation-issues | python, tensorflow, deep-learning, object-detection, object-detection-api | 1,722,339,973 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.