Category "pytorch"

Why is my Pytorch code significantly slower than Tensorflow?

I am trying to move my code from Tensorflow to Pytorch. Before doing this, I just simply test myself two frameworks. I expected two frameworks should show simil

Upgrade CUDNN to 8.2 in google colab

I wan to use upgrade the CUDNN version from 8.0 to 8.1 and CUDA version to 11.2, but I am not sure how we can do this on colab. Below is the script I wrote to r

How to solve "RuntimeError: CUDA error: invalid device ordinal"?

I'm trying to run this code. I don't know what is wrong with it, but this code is not running. and I don't know how to solve this problem. import cv2 from facia

Gradio - Pytorch MNIST Digit Recognizer

I watched the following video on YouTube https://www.youtube.com/watch?v=jx9iyQZhSwI where it was shown that it is possible to use Gradio and the learned model

PytorchStreamReader failed reading zip archive: failed finding central directory

I am trying to learn pytorch from a book, but it seems not a straight line for me. I coped the code below and pasted in my jupyter notebook for running but it g

Monai : RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 7 but got size 8 for tensor number 1 in the list

I am using Monai for the 3D Multilabel segmentation task. My input image size is 512x496x49 and my label size is 512x496x49. An Image can have 3 labels in one i

Reproducibility issue with PyTorch

I'm running a script with the same seed and I see results are reproduced on consecutive runs but somehow running the same script with the same seed changes the

Access all batch outputs at the end of epoch in callback with pytorch lightning

The documentation for the on_train_epoch_end, https://pytorch-lightning.readthedocs.io/en/stable/extensions/callbacks.html#on-train-epoch-end, states: To acces

Assigning custom weights to embedding layer in PyTorch

Does PyTorch's nn.Embedding support manually setting the embedding weights for only specific values? I know I could set the weights of the entire embedding laye

PyTorch bool value of tensor with more than one value is ambiguous

I am trying to train a neural network with PyTorch, but I get the error in the title. I followed this tutorial, and I just applied some small changes to meet my

Can I perform non-text sequence classification in fastai?

I am trying to figure out if I can use fastai for my problem. I am trying to classify sequences of floats. Each sequence is a vector of 24 floats. In principle,

Pytorch RuntimeError: CUDA out of memory with a huge amount of free memory

While training the model, I encountered the following problem: RuntimeError: CUDA out of memory. Tried to allocate 304.00 MiB (GPU 0; 8.00 GiB total capacity; 1

Difference between hidden dimension and n_layers in rnn using pytorch

I am stuck between hidden dimension and n_layers. What I understood so far, is that n_layers in the parameters of RNN using pytorch, is number of hidden layers.

Are anchor box sizes in torchvision's AnchorGenerator with respect to the input image, feature map, or something else?

This is not a generic question about anchor boxes, or Faster-RCNN, or anything related to theory. This is a question about how anchor boxes are implemented in p

Pytorch and Torchvision are compiled different CUDA versions

RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=10.2 and torchvision has CUDA Version=1

Semantic segmentation with detectron2

I used Detectron2 to train a custom model with Instance Segmentation and worked well. There are several Tutorials on google colab with Detectron2 using Instance

How can I see source code or explanation of "torch_sparse import SparseTensor"?

I am studying some source codes from PytorchGeometric. Actually I am really finding from torch_sparse import SparseTensor in Google, to get how to use SparseTen

using ImageFolder with albumentations in pytorch

I have a situation where I need to use ImageFolder with the albumentations lib to make the augmentations in pytorch - custom dataloader is not an option. To thi

Having Issues Loading the CelebA dataset on Google Colab Using Pytorch

I need to load the CelebA dataset for a Python (Pytorch) implementation of the following paper: https://arxiv.org/pdf/1908.10578.pdf The original code for loadi

RoBERTa classifier: cannot generate single prediction

I have succesfully trained a text emotion classifier fine-tuning a RoBERTa language model, mostly using a helpful notebook found online. Now I am trying to writ