Category "pytorch"

Why does torch.scatter requires a smaller shape for indices than values?

A similar question was already asked here, but I think the solution is not suited for my case. I just wonder why it is not possible to do a torch.scatter operat

CUDA error: device-side assert triggered on Colab

I am trying to initialize a tensor on Google Colab with GPU enabled. device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') t = torch.tensor([1,

fp16 inference on cpu Pytorch

I have a pretrained pytorch model I want to inference on fp16 instead of fp32, I have already tried this while using the gpu but when I try it on cpu I get: "su

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use tor

Google Colab GPU RAM depletes quickly on test data but not so on training data

I am training my neural network built with PyTorch under Google Colab Pro+ (Tesla P100-PCIE GPU) but encounters the following strange phenomenon: The amount of

Runtime error: CUDA out of memory by the end of training and doesn’t save model; pytorch

I'm not so experienced in Data Science and pytorch and I have problems with implementing at least anything here(currently I'm making a NN for segmentation tasks

How to extract tensors to numpy arrays or lists from a larger pytorch tensor

I have a list of pytorch tensors as shown below: data = [[tensor([0, 0, 0]), tensor([1, 2, 3])], [tensor([0, 0, 0]), tensor([4, 5, 6])]] Now this is ju

What and where am I going wrong in this code for pytorch based object detection?

I am using Yolov5 for this project Here is my code import numpy as np import cv2 import torch import torch.backends.cudnn as cudnn from models.experimental impo

AttributeError: module 'torch' has no attribute 'rfft' with PyTorch

I am getting an error using a code that should work according to the documentation. The goal is to calculate the Feature Similarity Index Measure (FSIM) using t

PyTorch torch.max over multiple dimensions

Have tensor like :x.shape = [3, 2, 2]. import torch x = torch.tensor([ [[-0.3000, -0.2926],[-0.2705, -0.2632]], [[-0.1821, -0.1747],[-0.1526, -0.1453]

Can I unpack an `nn.ModuleList` inside `nn.Sequential`?

I am parametrizing the number of hidden layers of a simple ANN using nn.ModuleList. I am wondering if passing this list into a nn.Sequential module as follows w

Send and load an ML model over Apache Kafka

I've been looking around here and on the Internet, but it seems that I'm the first one having this question. I'd like to train an ML model (let's say something

How do I load a local model with torch.hub.load?

I need to avoid downloading the model from the web (due to restrictions on the machine installed). This works, but it downloads the model from the Internet mode

Plot the Decision Boundary of a Neural Network in PyTorch

I've been trying to plot the decision boundary of my neural network which I used for binary classification with the sigmoid function in the output layer but wit

Issues installing PyTorch 1.4 - "No matching distribution found for torch===1.4.0"

Used the install guide on pytorch.org on how to install it and the command I'm using is pip install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorc

Saving the weights of a Pytorch .pth model into a .txt or .json

I am trying to save the the weights of a pytorch model into a .txt or .json. When writing it to a .txt, #import torch model = torch.load("model_path") string =

RuntimeError: 1D target tensor expected, multi-target not supported Python: NumPy

I am dealing with a CNN and I get the following error on the line loss = criterion(outputs, data_y): Here is the relevant code snippet: def run(model, X_train,

Why DETR need to set a empty class?

Why DETR need to set a empty class? It has set a "Background" class, which means non-object, why?

Why DETR need to set a empty class?

Why DETR need to set a empty class? It has set a "Background" class, which means non-object, why?

Pytorch CUDA error: no kernel image is available for execution on the device on RTX 3090 with cuda 11.1

If I run the following: import torch import sys print('A', sys.version) print('B', torch.__version__) print('C', torch.cuda.is_available()) print('D', torch.bac