Category "pytorch"

RuntimeError: CUDA out of memory with FastAPI

I try to make a backend server based on fastapi. My backend server works well with almost no errors, but I found an error situation. I allocate two services to

How should the output of my embedding layer look? Keras to PyTorch

I am in the process of translating a Keras implementation to a PyTorch one. After the full conversion my model was not converging fast enough, although the loss

Why detach needs to be called on variable in this example?

I was going through this example - https://github.com/pytorch/examples/blob/master/dcgan/main.py and I have a basic question. fake = netG(noise) label = Variab

How to save information about the result of instance segmentation by YOLACT?

Is there any way to save the detected categories, their number, MASK area, etc. to a TXT file or CSV file when performing instance segmentation using YOLACT? I&

Fine Tuning Pretrained Model MobileNet_V2 in Pytorch

I am new to pyTorch and I am trying to Create a Classifier where I have around 10 kinds of Images Folder Dataset, for this task I am using Pretrained model( Mob

Get the polygon coordinates of predicted output mask in YOLACT/YOLACT++

I am using Yolact https://github.com/dbolya/yolact ,an instance segmentation algorithm which outputs the test image with a mask on the detected object. As the i

How to calculate unbalanced weights for BCEWithLogitsLoss in pytorch

I am trying to solve one multilabel problem with 270 labels and i have converted target labels into one hot encoded form. I am using BCEWithLogitsLoss(). Since

Use of pytorch dataset for model inference- GPU

I am running T5-base-grammar-correction for grammer correction on my dataframe with text column from happytransformer import HappyTextToText from happytransform

what's the difference between "self-attention mechanism" and "full-connection" layer?

I am confused with these two structures. In theory, the output of them are all connected to their input. what magic make 'self-attention mechanism' is more powe

PyTorch - RuntimeError: [enforce fail at inline_container.cc:209] . file not found: archive/data.pkl

Problem I'm trying to load a file using PyTorch, but the error states archive/data.pkl does not exist. Code import torch cachefile = 'cacheddata.pth' torch.load

Pytorch tensor to PIL image with alpha channel

Using fastai v1, I have a model that transforms an image. When I plot the resulting image with matplotlib, the background is white; ax.imshow(image2np(img.data)

How to create a copy of nn.Sequential in torch?

I am trying to create a copy of a nn.Sequential network. For example, the following is the easiest way to do the same- net = nn.Sequential( nn.Conv2d(16

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