Category "pytorch"

Pytorch nn.CrossEntropyLoss() always returns 0

I am building a multi-class Vision Transformer Network. When passing my values through my loss function, it always returns zero. My output layer consisits of 37

torchaudio.sox_effects.sox_effects.apply_effects_file requires sox

I have installed sox using pip command, but it says that "torchaudio.sox_effects.sox_effects.apply_effects_file requires sox". Maybe I should install other addi

How to mask a 3D tensor with 2D mask and keep the dimensions of original vector?

Suppose, I have a 3D tensor A A = torch.arange(24).view(4, 3, 2) print(A) and require masking it using 2D tensor mask = torch.zeros((4, 3), dtype=torch.int6

Converting From .pt model to .h5 model

I am using Google colab. I want to convert .pt model from my google drive to .h5 model. I follow link https://github.com/gmalivenko/pytorch2keras and https://ww

RTX 3070 compatibility with Pytorch

NVIDIA GeForce RTX 3070 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilit

Duplicate layers when reusing pytorch model

I am trying to reuse some of the resnet layers for a custom architecture and ran into a issue I can't figure out. Here is a simplified example; when I run: imp

Can we use one optimizer for GAN model?

I have seen lots of GAN tutorials, and all of them use two separate optimizers for Generator and Discriminator. Their code looks like this. import torch.nn as n

SHAP explainer identifies wrong framework

I want to use the SHAP-DeepInterpeter on the Braindecode Shallow_FBCSP-Model which is based on pytorch. The training and testing works perfectly fine on the mod

Variational Autoencoder KL divergence loss explodes and the model returns nan

I'm training a Conv-VAE for MRI brain images (2D slices). the output of the model is sigmoid, and the loss function binary cross-entropy: x = input, x_hat = out

Deep Reinforcement Learning - CartPole Problem

I tried to implement the most simple Deep Q Learning algorithm. I think, I've implemented it right and know that Deep Q Learning struggles with divergences but

pytorch (cpu only) on osx fails with symbol not found

I am trying to get started with PyTorch - on a mac osx computer. However, basic steps fail: from torch_sparse import coalesce, SparseTensor -------------------

Can't set attribute for Pytorch LightningModule

I am trying to import initiate a LightningModule class module, but for some reasons i unable to set hparams. However if i change the name to hparams2 it suddenl

Converting a tf.dataset to a PyTorch Dataset?

I'm working on this project where all the data comes preprocessed and ready as a tensorflow datasets which looks like this: <MapDataset shapes: {input_ids: (

Variable args and keyword only args in a function

I was going thru PyTorch and found function signatures like torch.zeros(*size, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)

Detectron2 Speed up inference instance segmentation

I have working instance segmentation, I'm using "mask_rcnn_R_101_FPN_3x" model. When I inference image it takes about 3 second / image on GPU. How can I speed u

Displaying images loaded with pytorch dataloader

I am working with some lidar data images that I cannot post here due to a reputation restriction on posting images. However, when loading the same images using

Visualize Tensor [1,64,112,112] using matplotlib

I have a output tensor after convolution of dimensions [1,64,112,112]. Is there any way I can visualize this using matplotlib only, keeping in mind that imshow(

Is there really no padding=same option for PyTorch's Conv2d?

I'm currently working on building a convolutional neural network (CNN) that will work on time series data. More specifically, the data is financial data of shap

I want train a set of weight using pytorch, but the weights do not even change

I want to reproduce a method from a paper, the code in this paper was written in tensorflow1.0 and I want to rewrite it in pytorch. A brief description, I want

Load custom knowledge-graph data to pytorch geometric

I am new to PyTorch geometric and want to know how we can load our own knowledge-graph dataset into PyTorch geometric DataLoader. I have my data in the CSV file