Category "pytorch"

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

Is there any way to increase the size during memory sharing between process in PyTorch

My current code is like this: import torch import torch.multiprocessing as mp t = torch.zeros([10,10]) t.share_memory_() processes = [] for i in range(3):

How to change activation layer in Pytorch pretrained module?

How to change the activation layer of a Pytorch pretrained network? Here is my code : print("All modules") for child in net.children(): if isinstance(chi

any script to test the installation of Pytorch

I have installed the pytorch, and would like to check are there any script to test whether the installation is correct, e.g., whether it can enable CUDA or not,

ValueError: Target size (torch.Size([16])) must be the same as input size (torch.Size([16, 1]))

ValueError Traceback (most recent call last) <ipython-input-30-33821ccddf5f> in <module> 23 output = mod

load_from_checkpoint fails after transfer learning a LightningModule

I try to transfer learn a LightningModule. The relevant part of the code is this: class DeepFilteringTransferLearning(pl.LightningModule): def __init__(self