Top "Pytorch" questions

PyTorch is a deep learning framework that implements a dynamic computational graph, which allows you to change the way your neural network behaves on the fly and capable of performing backward automatic differentiation.

reshaping a tensor with padding in pytorch

I have a tensor with dimensions (30, 35, 49). I want to reshape it to (30, 35, 512) in order to be able to multiply with …

pytorch
How to use the BCELoss in PyTorch?

I want to write a simple autoencoder in PyTorch and use BCELoss, however, I get NaN out, since it expects …

torch autoencoder loss pytorch
What is the relationship between PyTorch and Torch?

There are two PyTorch repositories : https://github.com/hughperkins/pytorch https://github.com/pytorch/pytorch The first clearly requires Torch …

torch pytorch
CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`

I got the following error when I ran my pytorch deep learning model in colab /usr/local/lib/python3.6/dist-packages/…

nlp pytorch bert-language-model
Resize PyTorch Tensor

I am currently using the tensor.resize() function to resize a tensor to a new shape t = t.resize(1, 2, 3). This …

python runtime-error pytorch tensor deprecation-warning
Taking subsets of a pytorch dataset

I have a network which I want to train on some dataset (as an example, say CIFAR10). I can create …

python machine-learning neural-network torch pytorch
RuntimeError: Expected object of backend CUDA but got backend CPU for argument: ret = torch.addmm(torch.jit._unwrap_optional(bias), input, weight.t())

When the forward function of my neural network (after the training phase is completed) is being executed, I'm experiencing RuntimeError: …

python pytorch torch tensor
Can I slice tensors with logical indexing or lists of indices?

I'm trying to slice a PyTorch tensor using a logical index on the columns. I want the columns that correspond …

python matrix-indexing pytorch
How to remove the last FC layer from a ResNet model in PyTorch?

I am using a ResNet152 model from PyTorch. I'd like to strip off the last FC layer from the model. …

python pytorch resnet
How to resolve runtime error due to size mismatch in PyTorch?

I am trying to implement a simple autoencoder using PyTorch. My dataset consists of 256 x 256 x 3 images. I have built …

python pytorch autoencoder