Category "pytorch"

Pytorch transfer learning accuracy and lossess not improving. Resnet 50 and Cifar-10

I have been trying everything to fix this issue however my results are still the same, my validation accuracy, train_loss, val_loss are not improving. I have no

Split Datasets per labels

I want to split some datasets such as CIFAR10 or MNIST in a non-iid way: basically I am doing Federated Learning experiments, in which I want that each client h

Custom Dataset class for hierarchical dataset using “Local Classifier per Parent Node” technique

I’m working on an image classification model for hierarchical dataset using PyTorch implementation of EfficientNet. I am seeking help on how to edit my to

Pytorch Dataloader for .nifti.img files

I am trying to load the OSASIS-2 dataset in order to try to predict the onset of dementia. However, there does not, to my knowledge, exist a dataloader for this

Which method should I use to sample from a normal distribution?

I'm trying to sample batch_size points from an N-dim standard Gaussian distribution. But I noticed there are two similar functions I can use, and I want to know

how can I modify Dataset class to make the mask RCNN work with multiple objects?

I am currently working on instance segmentation. I follow these two tutorials: https://haochen23.github.io/2020/06/fine-tune-mask-rcnn-pytorch.html https://col

can't import torchtext.legacy.data

as i know, from torchtext 0.9.0, torchtext.data and torchtext.dataset are moved to torchtext.legacy but my 0.12.0 torchtext can't import torchtext.legacy while

The error of several nn.GRU layers in Pytorch model

Recently, I made a GRU model with Pytorch. When the model has one nn.GRU layer, it runs well. But when there are more than one GRU layer, the model would report

I am running my code on google colab. Am getting RuntimeError: CUDA error: device-side assert triggered.Error is showing for torch.manual_seed(seed)

import random total_steps = 1 seed = 42 random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) Below is the error am getting RuntimeError Traceback (mo

pytorch_lightning.utilities.exceptions.MisconfigurationException when training in pytorch lightning

I am training a sample model with dummy data then i got this error. I have gave everything properly but still i am getting this error: No `configure_optimizers(

Pytorch model object has no attribute 'predict' BERT

I had train a BertClassifier model using pytorch. After creating my best.pt I would like to make in production my model and using it to predict and classifier s

ModuleNotFoundError: No module named 'torchtext.legacy'

https://colab.research.google.com/github/saic-mdal/lama/blob/master/colab/LaMa_inpainting.ipynb#scrollTo=RwXRMaNHW4r5 Was checking out this code on colab. but g

Distributed sequential windowed data in pytorch

At every epoch of my training, I need to split my dataset in n batches of t consecutive samples. For example, if my data is [1,2,3,4,5,6,7,8,9,10], n = 2 and t

Can someone help? I want to do image classification using CNN while taking pose estimated as input

I hope you're all doing well. I'm new here for help. Basically, I have hand poses and labeled data for the image. for example image class is labeled as: 1: Hol

Get ROI feature vector from Faster R-CNN using Pytorch

I am training a faster R-CNN model in pytorch and I want to extract feature vector from roi-heads layer. I am using the following code: model = torchvision.mode

Training loss much lower than test loss even though it's using the same data

I'm using the same data for training and testing (which isn't best practice), and in theory the loss should be exactly the same. However, when training, my loss

Calculating joint probabilities from two tensors of different sizes in pytorch

I am trying to calculate joint probabilities from two tensors.. It's a little bit confusing for me. Suppose we have : a = torch.Tensor((10, 2)) b = torch.Tensor

Tensorflow: Create the torch.gather() equivalent in tensorflow

I want to replicate the torch.gather() function in TensorFlow 2.X. I have a Tensor A (shape: [2, 4, 3]) and a corresponding Index-Tensor I (shape: [2,2,3]). Usi

Converting PyTorch Boolean target to regression target

Question I have code that is based on Part 2, Chapter 11 of Deep Learning with PyTorch, by Luca Pietro Giovanni Antiga, Thomas Viehmann, and Eli Stevens. It's

I'd like to change the Keras to a pytorch, but I don't know how to build a neural network

The HAR dataset should be analyzed using LSTM and 1D CNN. I need to check the graph of the change in loss and check the confusion matrix. I don't know how to ma