Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [pytorch]

Pytorch is an open source library for Tensors and Dynamic neural networks in Python with strong GPU acceleration. For details, see https://pytorch.org.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Why is my model (using GATv2conv) stuck on its loss? (Predicting same value for every node)

I am trying to create a Geometric Deep Learning model using Pytorch. I have around 5000 graphs, which are split into a training set, validation set and test set. Every graph has one 'correct' node and ...
ThijsTUE's user avatar
-1 votes
0 answers
9 views

RuntimeError: mat1 and mat2 shapes cannot be multiplied (448x338 and 96x512) for time series

This is the shape of x_enc: torch.Size([32, 338, 6]) This is the shape of x_mark_enc: torch.Size([32, 338, 8]) RuntimeError Traceback (most recent call last) Cell In[15], ...
Anant Trivedi's user avatar
-1 votes
0 answers
14 views

RuntimeError in a Simple QA model using Transformer

I am new to transformer architecture. I am trying to build a model that will generate answers to questions. For simplicity, I am using three sample questions and answers in a pandas dataframe. After ...
Ishrat Hossain's user avatar
5 votes
1 answer
143 views

Changing output size from a model

So I am currently training some deep learning models for some basic classification problems, and I am trying to figure out if it is possible to change the output size of the model in case I want to ...
pdaranda661's user avatar
0 votes
0 answers
9 views

diffusion model: can't overfit on single batch

I am training the diffusion model from diffusion policy, specifically their vision notebook, on a custom dataset. As always, I try to make a sanity check of the pipeline, by overfitting on a single ...
Felix Hegg's user avatar
0 votes
0 answers
8 views

pytorch is_leaf problem

I have a problem about is_leaf of the rotation_matrix i defined below in picture 1.Picture 2 shows how do i get rotation[i] by using getattr to get it from model_params. Picture 3 shows how do i use ...
Ecthelion's user avatar
1 vote
1 answer
19 views

Is there a method to impute missing temperature values in time series that considers external factors?

I have 10 day temperature forecast data that is hourly initially and then every 3 hours. I would like to predict the hourly values for the full 10 days. Linear interpolation fails as sunrise and other ...
John's user avatar
  • 111
0 votes
0 answers
7 views

PyTorch YoloV5 model does not recognize objects

I am trying to build a yolov5 object detection model using parts of a model car. I took 200 pictures of each part, annotated them and trained the model for 50 epochs. Now, the model does not recognize ...
Ladan's user avatar
  • 1
1 vote
1 answer
32 views

How do I get model.generate() to omit the input sequence from the generation?

I'm using Huggingface to do inference on llama-3-B. Here is my model: ...
Ameen Izhac's user avatar
1 vote
0 answers
14 views

Efficiently Implement a Data Transformation || Pytorch || coding advice

I have created the following class and function to create a 'custom' dataset. The use case was to sample every nth image from a data set to reduce the size of the data set while still maintaining ...
James's user avatar
  • 21
1 vote
1 answer
34 views

Unordered Set Classification Problem

In my setup I have one feature which is a sparse list representing categories. For example, let's say that we have M categories in the interval ...
dpalma's user avatar
  • 111
1 vote
0 answers
13 views

Transfer Learning - GoogLeNet - Training Times || Loss not converging || Pytorch

Hi Community and thanks in advance for the help. I am working on transfer learning - specifically GoogLeNet model with the Food101 Dataset. Code is below. I think everything is in order from data ...
James's user avatar
  • 21
0 votes
0 answers
27 views

Extremely Imbalanced and Gapped Dataset in Regression Problem

Currently I am working with a biological dataset with a range of 0-to-1 to do a multi-task regression with Deep Learning. However, this dataset has an empty gap in the range 0 to 0.2 (however there ...
Abdullah Faqih's user avatar
0 votes
0 answers
10 views

Problem when merge two probability distribution [Pointer Network]

I'm trying to re-implement Pointer Gen Net from this paper. Ya but you don't really need to read the paper. To sum up briefly, I have a vector probability distribution over vocabulary called p_vocab. ...
jupyter's user avatar
  • 101
1 vote
1 answer
44 views

Does using different optimizer change the loss landscape

I plot the landscape using this code, and I notice the landscape shape has changed a lot. My understanding is that the optimizer does not change the loss landscape. But now I'm confused if its just ...
user836026's user avatar
1 vote
0 answers
19 views

word2vec predicts the same word for all inputs

i build word2vec network with 2 linear layers from pytorch. for every word as an input i consistently train model to predict words before and after, for example: i was visiting my grandma's house, for ...
Тима 's user avatar
0 votes
0 answers
115 views

How to properly prune a YOLOv8 model

I was trying to apply pruning to a YOLOv8 detection model. Following is my code and it runs successfully. I see the saved pruned model as well. My YOLOv8 model has 22 layers (an example list of layers ...
Mary H's user avatar
  • 1
0 votes
1 answer
27 views

Why torch activation functions contains parameters?

What is the purpose of the weights?
Тима 's user avatar
0 votes
1 answer
14 views

Understanding batching in pytorch models

I have following model which forms one of the step in my overall model pipeline: ...
Mahesha999's user avatar
0 votes
1 answer
19 views

Pytorch backward error

Here I overcame a problem about backward, below is a simple example written by python code. the print information is that This really confused me as self.weights is used as a important part in my ...
Ecthelion's user avatar
0 votes
1 answer
22 views

Applying dropout effectively in CNN

I am fairly new to deep learning and machine learning in general and have been trying to teach myself. I’m interested in understanding when and how to effectively use dropout in a CNN. While ...
Nile's user avatar
  • 3
0 votes
0 answers
5 views

Adding sliding window dimension to data causes error: "Expected 3D or 4D (batch mode) tensor ..."

I wrote a pytorch data loader which used to return data of shape (4,1,192,320) representing the 4 samples of single channel image, each of size ...
Mahesha999's user avatar
0 votes
0 answers
21 views

Multiclass PyTorch neural net is stuck predicting 1 class, even with "simple" dataset

I'm trying to predict a class of some data, and am struggling. So, to debug I created a simple test dataset, yet I am having the same issues. I've tried adding weighting, and lastly adding a column ...
Russ's user avatar
  • 1
0 votes
0 answers
17 views

Training the neural network does not give the expected result

I'm trying to create a pytorch neural network capable of recognizing peaks in 2D graphs. Previously, I was able to get a result close to what I wanted, but it was not ideal and did not give a ...
AlterEGO's user avatar
0 votes
0 answers
22 views

ML Methods For Modelling Latent Variables

I have some time series predictor variables, $\{\mathbf{X}_t\} = \{\mathbf{X}_0, \ldots, \mathbf{X}_n\}$, and some other time series data $\{\mathbf{Z}_t\} = \{\mathbf{Z}_0, \ldots, \mathbf{Z}_n\}$. ...
baked goods's user avatar
0 votes
0 answers
13 views

Why is my 3D CNN stuck at constant accuracy?

I am writing a CNN for binary classification MedMNIST data: https://medmnist.com/, specifically the Lung Nodule 3D dataset (N=1633 and 7:1:2). Currently, my model is not training at all; it is either ...
Matthew H's user avatar
1 vote
0 answers
24 views

Validation loss and training loss is not increasing in pytorch

validation loss and training loss is not increasing. I try to imply l2 regularization in form of weight decay as 0.05 but I have removed and tried maybe that could be the reason. I have even removed ...
beschichtung346's user avatar
1 vote
0 answers
32 views

Gaussian process regression not working in GPytorch and Scikit-learn, can't find suitable hyperparameters

This is a MWE of my problem, basically I want to find out the map between qin and qout using a Gaussian process and with that ...
Hans's user avatar
  • 111
0 votes
0 answers
8 views

Add a custom loss in a public github repository on distillation

I’m trying to implement a custom loss in a public repository regarding knowledge distillation. The link to the repository is the following: " https://github.com/DefangChen/SimKD " The main ...
PiEmmeC's user avatar
2 votes
1 answer
775 views

FutureWarning in pandas when working with Series

I'm coding a custom (but simple) dataset for training an MLP with PyTorch. Basically, my data are numeric vectors of two classes so the whole dataset is a ...
leapofFaith's user avatar
0 votes
0 answers
84 views

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:3! in DPOTrainer with ec2 G5 12X Large

...
Sandun Tharaka's user avatar
0 votes
0 answers
11 views

CNN matrix shape issue when adding new convolutional layer

I have been adding more & more convolutional layers to my model to see how they effect model size & accuracy. It was all going fine until I added my 6th convolutional layer. ...
DrBwts's user avatar
  • 101
1 vote
0 answers
50 views

Negative MNIST - Trying to understand what's going on here

I'm new to machine learning and pytorch and any insight would be greatly appreciated. I've been playing around with the MNIST number recognition dataset and thought it would be interesting to train ...
Sloth Man's user avatar
  • 111
0 votes
0 answers
38 views

Semantic segmentation sometimes give bad result

I'm training Unet+MobileNetV3 for semantic segmentation objects on real photos using custom dataset and get strange results. I have already accumulated pretty big dataset and constantly improve it by ...
Vladislav D's user avatar
0 votes
0 answers
11 views

Seeking ML Model Recommendations for Enhancing OCR on Corrupted Text Images

I am working on a project where I need to perform Optical Character Recognition (OCR) on text-based images. However, these images are corrupted in various ways (e.g., blurred, distorted, low ...
Nurbek Ss's user avatar
0 votes
0 answers
65 views

Safetensors are slower than torch.load. Why?

Lately, I have been testing safetensors. It claims that the safetensors are faster and safer than pickle. So I did my own comparison with the code below: ...
mark's user avatar
  • 103
1 vote
0 answers
26 views

How to apply this schematic of a CNN?

I'm trying to apply a model from a paper to my problem, however I get very poor results (R² = 0.1 for regression). I think I don't understand the schematic drawing of the CNN used in the paper. Could ...
YPOC's user avatar
  • 111
1 vote
1 answer
22 views

Extraction of name from phonetic transcription

I have a use case where I want to extract the name from the phonetic transcription. For example if the phonetic transcription is - “m a j n e j m ɪ z s ʌ m i ɹ z o w ʃ i”, the output should be the ...
Sameer Joshi's user avatar
0 votes
0 answers
38 views

reverse summary matching

How can we develop a model to assess the relationship between a summary and a text, enabling it to determine their coherence but in reverse? Also, how to make an inference We have list of texts (2000) ...
whoopdedoo's user avatar
-1 votes
1 answer
51 views

Why is my NN model's prediciton for y= sinc(x) function showing symmetric?

...
RimaMonica's user avatar
0 votes
1 answer
20 views

How to get the closest samples to time series dataset?

I have a deep learning time series classification model. I want to understand if the model failed to classify, due to missing or incorrupt training inputs. For simplicity let's say we have a training ...
user3668129's user avatar
1 vote
1 answer
35 views

How to add a new item in the embeddings vocabulary?

Imagine you have trained a model containing an Embedding layer. Your model performs well and you're happy with your embedding. Then, suddenly, you want to add a new item in your vocabulary. In other ...
MarcoM's user avatar
  • 111
0 votes
0 answers
18 views

Custom loss function for collinearity of 3 embeddings

I am trying to implement a loss function that takes as input 3 embeddings and output a value that is proportional to the collinearity of the embeddings. This is to shape the latent space of a ...
vlc's user avatar
  • 1
0 votes
0 answers
15 views

How to detect abnormal fetal head size with image classification?

I'm writing Python code to predict fetal head circumference 10mm range using classification. The model will train to classify a fetal head image into a range (e.g., 50–60 mm) representing its ...
NiStack's user avatar
0 votes
1 answer
27 views

Performance difference between two equivalent ML codes

Using the two Python libraries GPyTorch and scikit-learn to perform Gaussian Process Regression (GPR) for a machine learning task, I have encountered a problem I failed to solve during the last days. ...
C_Swann22's user avatar
  • 111
0 votes
0 answers
10 views

Help with a MaNet finetuning (binary semantic segmentation task)

Introduction: I am currently working on a computer vision problem, I have satellite images and I have to detect a particular archeological structure (Tell). I have access to the previously made ...
Alessandro Pistola's user avatar
1 vote
2 answers
31 views

Image segmentations vs image detection

If I need to detect on an image some objects and we are only interested in counting them, between image segmentation and object detection which one would you think would yield best results in terms of ...
Dinu Mihai's user avatar
0 votes
0 answers
10 views

Is it fair to say that Hausdorff Distance (HD) focuses on low level details while dice score (DSC) high level

I wonder if its make sense to say that Hausdorff Distance (HD) measures low-level details while dice score (DSC) focuses on high levels. If you could cite a paper, I would appreciate it.
user836026's user avatar
0 votes
0 answers
26 views

CNN segmentation models: class weights specification on IoU metric

I am building a MANet model using pytorch lightning. For getting the model I use the library segmentation models. As my objective is to do binary semantic segmentation, during the test phase I ...
Alessandro Pistola's user avatar
0 votes
0 answers
23 views

why does my multi-modal model can not learn anything?

I have a multi-modal model. I want to train it using the Pytorch Framework. I have a balanced dataset. I have approximately 150 samples for each client. (I had preprocessed my text data.) when I train ...
arcane_data's user avatar

1
2 3 4 5
15