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.

pytorch how to set .requires_grad False

I want to set some of my model frozen. Following the official docs: with torch.no_grad(): linear = nn.Linear(1, 1) …

python pytorch gradient-descent
Pytorch softmax: What dimension to use?

The function torch.nn.functional.softmax takes two parameters: input and dim. According to its documentation, the softmax operation is …

python pytorch
How to do gradient clipping in pytorch?

What is the correct way to perform gradient clipping in pytorch? I have an exploding gradients problem, and I need …

python machine-learning deep-learning pytorch gradient-descent
How do you load MNIST images into Pytorch DataLoader?

The pytorch tutorial for data loading and processing is quite specific to one example, could someone help me with what …

python pytorch
Cannot convert list to array: ValueError: only one element tensors can be converted to Python scalars

I'm currently working with the PyTorch framework and trying to understand foreign code. I got an indices issue and wanted …

python numpy pytorch numpy-ndarray
CMake on Linux CentOS 7, how to force the system to use cmake3?

I tried to install PyTorch on my Linux CentOS 7.3. I downloaded its package, ran this command and got this error: …

python-2.7 cmake centos centos7 pytorch
PyTorch: How to use DataLoaders for custom Datasets

How to make use of the torch.utils.data.Dataset and torch.utils.data.DataLoader on your own data (not …

python torch pytorch
Concatenate Two Tensors in Pytorch

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 2. Got 32 and 71 in dimension 0 at /pytorch/aten/src/THC/…

python machine-learning deep-learning pytorch tensor
Cross Entropy in PyTorch

I'm a bit confused by the cross entropy loss in PyTorch. Considering this example: import torch import torch.nn as …

machine-learning deep-learning pytorch entropy loss
How to load a list of numpy arrays to pytorch dataset loader?

I have a huge list of numpy arrays, where each array represents an image and I want to load it …

python numpy pytorch