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
0answers
7 views

mismatch between shapes using BERT

I used PyTorch to get word-embeddings using BERT for my sentences which are 150074 sentences....
1
vote
0answers
13 views

How do you solve strictly constrained optimization problems with pytorch?

I am trying to solve the following problem using pytorch: given a six sided die whose average roll is known to be 4.5, what is the maximum entropy distribution for the faces? (Note: I know a bunch of ...
0
votes
0answers
12 views

Hidden state dimensions in Pytorch LSTM

Please read the question completely before you mark it as duplicate I was trying to understand the syntax of using an LSTM in PyTorch. I came across the following in PyTorch docs. ...
0
votes
2answers
19 views

How to add positional embedding in an attention based model which takes custom feature embedding as input?

I am working on building an attention based deep neural network model where I fed this with a variable length of custom feature embeddings. I would like to provide positional information for my custom ...
2
votes
0answers
9 views

Best practices to train a transformer text classifier to predict/handle unseen labels

I fine-tuned a RoBERTa sequence classifier to classify paragraphs of certain documents using labeled paragraphs only (and skipping paragraphs with no label given). The model was validated and tested ...
0
votes
0answers
5 views

Reference code for LSTM Variational Autoencoder for dimensionality reduction

I have time series data, with many features. I would like to reduce the dimentionality by using LSTM VAE. Does anybody know an example code or a reference to guide me to impolement it? Both Pytorch ...
0
votes
1answer
20 views

Training loop stops after the first epoch in PyTorch

I'm trying to train a seq2seq model using PyTorch using the Multi30K dataset from Dutch to English language. Here is my snippet of code: CustomMulti30k class ...
1
vote
0answers
12 views

What is an efficient implementation of a custom map-style dataset for a hdf5 file with irregular structure?

I have a hdf5 file that contains picture of a certain number of people, from a certain number of source cameras, for many seconds. So it is like this: ...
0
votes
0answers
17 views

Variational autoencoder for time series denoising and dimentionality reduction

I have a dataset X of multiple series say 100 (size=100). I would like to use VAE to both denoise the data and reduce the dimensions to a smaller latent space Z (size Z << size X), because I ...
0
votes
0answers
17 views

How Flair (NER) works?

I have found multiples papers (or websites) about flair. All those papers describes how to use flair for NER. I didn't found any paper or (websites) that describe flair architecture and how it works. ...
0
votes
1answer
31 views

Why do I get different results at inference time even with fixed seed?

I am a very beginner in deep learning and am playing with voice cloning project. I trained my dataset and used the trained model to synthesize some sentences and was surprised to get a very different ...
0
votes
0answers
4 views

Does the clip duration in a training dataset affect the inference output?

I am a very beginner in deep-learning and am playing with a voice cloning project (involving Tacotron 2 model). For that I am building a training dataset to make a French voice. My goal is to get ...
1
vote
0answers
29 views

Why is newer GPU slower than older one during training?

I am a very beginner in deep learning and am training a Tacotron 2 model written in PyTorch (see the link if it matters) on Google Colab and was lately granted an ...
1
vote
0answers
90 views

Why do we use squeeze(1) at this model definition with PyTorch?

PyTorch noobie here. I'm following an online tutorial and there's a simple model definition as follows: ...
0
votes
0answers
21 views

Feature Map setup for Faster RCNN with resnet50 backbone

I'm trying to get an activation map using a Faster RCNN Resnet50 backbone, but am having issues getting the proper hook setup for output information. Most of the libraries, like gradcam, don't seem to ...
0
votes
0answers
37 views

Custom Dataloader in pytorch

I am working on an image classification project where I have some images in a folder and their corresponding labels in a CSV file. The indices are randomly arranged in the dataframe where the index ...
0
votes
0answers
22 views

Instance segmentation - Which is the best approach for my use case?

I am looking to train an instance segmentation model that will be running on the edge, like on mobile devices. What is the best network (Mask RCNN, DeepLab v2/3 etc.) for this use case? Which gives ...
1
vote
1answer
35 views

Get Hidden Layers in PyTorch TransformerEncoder

I am trying to access the hidden layers when using TransformerEncoder and TransformerEncoderLayer. I could not find anything ...
1
vote
1answer
37 views

How can I classify multiple images "simultaneously"?

I am dealing with a multiclass image classification problem with N classes. Particularly interesting is now that a single instance is NOT a single image as you would expect normally, but rather a set ...
1
vote
0answers
45 views

Why is the DenseNet official implementation different to the paper?

I've tried to implement DenseNet from scratch (https://arxiv.org/pdf/1608.06993.pdf), but have run into some confusion after finding the official PyTorch implementation of DenseNet (https://github.com/...
0
votes
0answers
9 views

ignoring instances or masking by zero in a multitask learning model

For a multitask learning model, I've seen that approaches usually mask the output that doesn't have a label with zeros. As an example, have a look here: How to Multi-task learning with missing labels ...
0
votes
0answers
12 views

How to create 2D visualization of loss for weights in PyTorch model?

I am looking to create visualization of this type for PyTorch ResNet model to see trajectories of optimization. Could anyone provide me code sample for that?
0
votes
0answers
9 views

Should Non-Max Suppression (NMS) be tuned as a hyperparameter?

This may be a silly question, but when tuning hyperparameters for an object detection model, should we tune the NMS threshold, or is this better left to tune by hand afterwards? For region-proposal ...
1
vote
0answers
9 views

Is there a reason not to wirk with AMP (automatic mixed precision)?

According to: Introducing native PyTorch automatic mixed precision for faster training on NVIDIA GPUs It's better to use AMP (with 16 Floating Point) due to: Shorter training time. Lower memory ...
0
votes
0answers
19 views

Is it possible to pass in an empty annotation to signify just a background/negative image for faster RCNN?

I'm using a pretrained resnet50 for faster RCNN to detect areas with 2 classes (background and interest class). As part of my data inputs for training, I have background images without any annotation ...
0
votes
0answers
13 views

Does using torch.cuda.empty_cache can decrease performance?

We're struggling with memory usage in a project that deploys multiple models to the same GPU (models are usually built with PyTorch and TensorFlow). It was suggested that we could use ...
0
votes
0answers
14 views

Pytorch different result when using `torch.matmul` and `for-loop` to pass input through linear layers

I have been at this for about two days now. I am working on a model that takes on an input x and passes it through several linear layers, and concatenates the ...
0
votes
0answers
12 views

Pytorch torchvision: Efficient way of calculating the mean and stds for images in the train set from datasets.ImageFolder

Let us say I have the loading images from my local files using the pytorch torchvision datasets.ImageFolder as follows: ...
0
votes
1answer
57 views

resnet50 implementation for semantic segmentation

I am new to resnet models. I want to implement a resnet50 model for semantic segmentation I am following the code from this video, but my numclasses is 21. I have a few questions: If i pass in any ...
0
votes
0answers
9 views

Resnet34 vs ResNet34d

Can someone please explain to me the difference between resnet34 and resnet34d? Is resnet34d simply double a normal resnet34? Also for both, what are the input and output sizes of each layer?
0
votes
0answers
15 views

How to shape data when using LSTM autoencoder

I am working with simple data that has multiple features and a time stamp column. I have 24 hours of data across 70 days. The total number of samples is 1680. When applying a LSTM autoencoder, how ...
0
votes
1answer
54 views

How to convert horizontal bounding box coordinates to oriented bounding box coordinates

I am trying to detect oriented bounding boxes with faster rcnn for a long time, but I could not make it to do so. I aim to detect objects in the DOTA dataset. I was using built-in faster rcnn model in ...
0
votes
0answers
34 views

How to get the Feature visualization for pre-trained resnet50 models?

I'm trying to visualize some of the features from a pre-trained resnet50 FasterRCNN. The model downloaded is from torchvision: ...
0
votes
0answers
106 views

How to track loss and accuracy in PyTorch?

I have made model and it is working fine for the MNIST dataset but further in the assignment it says to track loss and accuracy of the model, which I do not know how to do it. I have also written some ...
1
vote
0answers
18 views

Why is PyTorch's Dataloader is not inerrable?

I am working on MNIST dataset for an assignment and it seems to be I am stuck at some point for long. I have wrote my code for LogisticRegression and when I try to train the model it is not working as ...
0
votes
0answers
9 views

What is the reason of this behavior of training loss in CONV auto-encoders?

I don't get Training Loss is steady up to the 7th epochs
1
vote
0answers
7 views

If an FCN accept rectangular image as input or has to be square?

Some say that for FCN it doesn't matter if the input image is rectangular the only thing matters that the size must be constant ...
1
vote
0answers
52 views

Linear regression with Pytorch not converging

I am trying to perform a simple linear regression using Pytorch lightning (a network with only one neuron). The network is supposed to learn a simple function: y=-4x...
1
vote
0answers
15 views

Can a framework use both CPU and GPU in parallel for inference?

Can a framework use both CPU and GPU in parallel for inferencing a model? It seems possible but wondering if any of the frameworks like TensorFlow or PyTorch done this? To explain further, can we use ...
2
votes
1answer
43 views

Differentiable approximation for counting negative values in array

I have an array of time of arrivals and I want to convert it to count data using pytorch in a differentiable way. Example arrival times: ...
1
vote
1answer
27 views

Should I apply Softmax before calculating metrics Precision or similar?

I am using PyTorch Lightning (there is no tag for this and I don't have enough reputation to create one) and am facing a multi classification problem. My loss function is ...
0
votes
0answers
15 views

Gradients are becoming None in PyTorch

...
0
votes
1answer
83 views

Gradients None in PyTorch

...
1
vote
1answer
39 views

Pytorch: How to make sure that all labels are present in each batch

How to make sure that each batch will have samples with all the labels? For example, consider sentiment analysis problem with labels positive and negative. ...
0
votes
1answer
16 views

ResNet output dimensions of initial convolution don’t yield in an integer

I am trying to understand the ResNet dimensions, but got stuck at the first layer. We are passing a [224x224x3] image into 64 filters with kernel size 7x7 and stride=2. According to the ResNet source ...
2
votes
1answer
90 views

Is my approach about the ML model correct?

First of all, I am a newbie here and it is my first question on this platform, so I apologize for the mistakes about the format if there are any. In my thesis study, I am trying to identify the non-...
0
votes
0answers
13 views

Fusion (concatenation or elementwise) of coarse (deep) and high-res (shallow) features in ResNet, FPN and UNet

I understand this functionality, but I've neither the intuition nor reasons why this works. I'm looking at three cases of this fusion: ResNet, UNet and Feature Pyramid Net (FPN). In ResNet, in each ...
1
vote
0answers
15 views

Adding data in PyTorch that will not be in features or labels

I have a neural network that I'm training on a set of 7 features, but would like to also add an extra data array that is not going to be a feature or a label. Specifically, I'm training a network to ...
1
vote
0answers
21 views

Failed to synchronize: cudaErrorIllegalAddress: an illegal memory access was encountered [closed]

While running a code I am encountering this error any ideas on how to resolve this

1
2 3 4 5
11