Category "pytorch"

How to use multiprocess when input is a torch.tensor with gradient?

import torch.multiprocessing as mp import torch import time class test(): def __init__(self,X,Y): self.X=X #.share_memory_() self.Y=Y

Improve Python (.exe) startup time

I created an exe with the PyInstaller. As soon as I enable the --onefile flag. The exe needs several minutes to start. When I build the application with the --o

IndexError: Target 11 is out of bounds. cross-entropy

How can I change the attached model to fit my dataset for the Bayesian model? my data include 5 variables and 32 results model = nn.Sequential( bnn.BayesLin

GPU out of memory with Pyannote

I'm using Pyannote and when I run the following from pyannote.audio import Pipeline pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization") diariza

Pytorch throws CUDA runtime error on WSL2

I install Nvidia Windows Driver and CUDA according to this article. After the installation of Nvidia Windows Driver, I’ve checked CUDA version by running

Is there any faster way to get word embeddings given sub-word embeddings in BERT

Using bert.tokenizer I can get the subword ids and the word spans of words in a sentence, for example, given the sentence "This is an example", I get the encode

Training of Siamese Network with Contrastive Loss Misses Parameter Updates

I try to implement a rather simple siamese network and a contrastive loss function. I use a pre-trained VGG16 as a backbone model and strip away the last ReLU a

Inputing a torch 3d tensor into a keras.Sequential model

Here I have a pytorch tensor object which I need to use for training a neural network. Can pytorch tensors be used for training a keras neural network and if so

Define flatten layer in neural network using pytorch

I'm trying to define a flatten layer before initiating fully connected layer. As my input is a tensor with shape (512, 2, 2), so I want to flatten this tensor b

Assign memory blob to py-torch output tensor (C++ API)

I am training a linear model using py-torch and I am saving it to a file with the "save" function call. I have another code that loads the model in C++ and perf

How padding works in PyTorch

Normally if I understood well PyTorch implementation of the Conv2D layer, the padding parameter will expand the shape of the convolved image with zeros to all f

Pytorch Forecasting: Loading a custom dataset

I'm trying to load a custom dataset to PyTorch Forecasting by modifying the example given in this Github repository. However I'm stuck at instantiating the Time

Trouble extracting numbers from helib::Ctxt ciphertext

I'd like to access directly to the numbers composing the ciphertext Ctxt from HElib, but reading the documentation I don't seem to find anything that can help m

Colab crashes when trying to create confusion matrix

I am trying to create a confusion matrix for my test set. My test set consists of 3585 images. Whenever I try to run the following code: x_test,y_test = next(it

RuntimeError: DataLoader worker (pid(s) 15876, 2756) exited unexpectedly

I am compiling some existing examples from the PyTorch tutorial website. I am working especially on the CPU device no GPU. When running a program the type of er

how to capture logger values using clearml

I am using clearml for testing algorithms and it works well with library Stable Baselines 3, in which clearml automatically captures all the output and plot the

Convert a pth pytorch file to an onnx model

I'm trying to convert a PyTorch model(pth file containing weights) to an onnx file then to a TensorFlow model since I work on TensorFlow. to then fine-tune it.

Sentence Pair Classification using BERT Transformers Value Error

I was doing sentence pair classification using BERT. At first, I encode the sentence pair as train_encode = tokenizer(train1, train2,padding="max_length",trunca

Pytorch AttributeError: can't set attribute

I'm using pytorch lightining and I have this error but I'm non really understanding what is the problem. I create a Deep Learning pipeline to run with hyperpara

Pytorch Training; "Runtime Error:PyTorch and torchvision versions are incompatible ..."

SOLUTION at the bottom! I want to do Object Detection with this tutorial: https://towardsdatascience.com/building-your-own-object-detector-pytorch-vs-tensorflow