Category "pytorch"

CUDA crashes under some certain situation

I am using pytorch 1.8.2 LTS + CUDA 11.1 + CuDNN 8.0.4 under Ubuntu 18.04. It crashes oddly under some certain situation. The problem can be reproduced as follo

CUDA crashes under some certain situation

I am using pytorch 1.8.2 LTS + CUDA 11.1 + CuDNN 8.0.4 under Ubuntu 18.04. It crashes oddly under some certain situation. The problem can be reproduced as follo

pytorch DataLoader extremely slow first epoch

When I create a PyTorch DataLoader and start iterating -- I get an extremely slow first epoch (x10--x30 slower then all next epochs). Moreover, this problem occ

Using PyTorch grid_sample to reconstruct left image from right image and inverse depth

I'm implementing the basic architecture from this paper: https://arxiv.org/pdf/1705.08260.pdf in PyTorch. It consists of an autoencoder and Spatial Transformer.

Huggingface distilbert-base-uncased-finetuned-sst-2-english runs out of ram with only a few kb?

My dataset is only 10 thousand sentences. I run it in batches of 100, and clear the memory on each run. I manually slice the sentences to only 50 characters. Af

Loss not decreasing - Pytorch

I am using dice loss for my implementation of a Fully Convolutional Network(FCN) which involves hypernetworks. The model has two inputs and one output which is

Loss not decreasing - Pytorch

I am using dice loss for my implementation of a Fully Convolutional Network(FCN) which involves hypernetworks. The model has two inputs and one output which is

What is the difference between Tensor.size and Tensor.shape in PyTorch?

What is the difference between Tensor.size and Tensor.shape in Pytorch? I want to get the number of elements and the dimensions of Tensor. For example for a ten

Compute maxima and minima of a 4D tensor in PyTorch

Suppose that we have a 4-dimensional tensor, for instance import torch X = torch.rand(2, 3, 4, 4)

how to modify resnet 50 with 4 channels as input using pre-trained weights in Pytorch?

I would like to change the resnet50 so that I can switch to 4 channel input, use the same weights for the rgb channels and initialize the last channel with a no

Multiclass semantic segmentation model evaluation

I am doing a project on multiclass semantic segmentation. I have formulated a model that outputs pretty descent segmented images by decreasing the loss value. H

How to reduce model size in Pytorch post training

I have created a pytorch model and I want to reduce the model size. Defining Model Architecture :- import torch import torch.quantization import torch.nn as nn

Replace torch.gather by other operator?

I have one script code, where x1 and x2 size of 1x68x8x8 tmp_batch, tmp_channel, tmp_height, tmp_width = x1.size() x1 = x1.view(tmp_batch*tmp_channel, -1)

version `GLIBC_2.28' not found

I'm trying to install PyTorch on ARMv7(32-bit) architecture but PyTorch doesn’t have official ARMv7 builds so i tried this unofficial build. It installed

Extracting labels after applying softmax

I have a multi class classification neural network. I apply softmax at the end to get probabilities for my classes. However, now I want to pick the maximum prob

PyTorch Model Training: RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR

After training a PyTorch model on a GPU for several hours, the program fails with the error RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR Trainin

TypeError: forward() takes 1 positional argument but 2 were given

class DeConv2d(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, stride, padding, dilation): super().__init__() self.up

Is torch.as_tensor() the same as torch.from_numpy() for a numpy array on a CPU?

On a CPU, is torch.as_tensor(a) the same as torch.from_numpy(a) for a numpy array, a? If not, then why not? From the docs for torch.as_tensor if the data

'no module named cv2' import error on pytorch

I am currently studying Pytorch and trying to use the cv2 module. I am using Jupyter notebook and Windows. I have installed opencv like this: !pip install op

Asking gpt-2 to finish sentence with huggingface transformers

I am currently generating text from left context using the example script run_generation.py of the huggingface transformers library with gpt-2: $ python transf