Questions tagged [torch]
The torch tag has no usage guidance.
22
questions
0
votes
0
answers
108
views
Input type (MPSFloatType) and weight type (torch.FloatTensor) should be the same
I am trying to run this notebook on Apple M1 (1st gen) running MacOS 12.4,
libs freeze:
...
0
votes
0
answers
73
views
Pytorch torchvision: Efficient way of calculating the mean and stds for images in the train set from datasets.ImageFolder
Let us say I have the loading images from my local files using the pytorch torchvision datasets.ImageFolder as follows:
...
0
votes
0
answers
13
views
What is the reason of this behavior of training loss in CONV auto-encoders?
I don't get Training Loss is steady up to the 7th epochs
0
votes
0
answers
60
views
converting a KL divergence from torch to pytorch
The following code is the KL divergence between a Gaussian posterior and mixture of Gaussian priors and it is part of the model described in this paper. The published code is written in torch language
...
1
vote
1
answer
2k
views
1D target tensor expected, multi-target not supported
I am trying to train my model.
My model outputs a [4,2] tensor where 4 is the batch size and 2 because of binary classification.
After receiving the outputs I found the index of the maximum element ...
0
votes
0
answers
60
views
How can I reshape (16,) and (3,112,112) shape to the single (16,3,112,112)? See code below
This is my code;
for img_loc in list(self.train_data)[idx]:
images_set.append(self.load_ucf_image(img_loc))
print(images_set)
And, this is its output
...
1
vote
2
answers
3k
views
Save and Load Simple Transformer Model
I have trained Text classifier using simpleTranformer.ai I am struggling to save and load the model in docker container. Please let me know how can I save the trained model and then load it into ...
0
votes
1
answer
86
views
Torch tensor view and stride mechanics
I want my Mx2xN float tensor to become MxN complex tensor.
In this minimal example I supply the the 10x2 matrix which should become the vector [0+10j,1+11j,2+12k,...]
...
0
votes
1
answer
127
views
Why does my GPU immediately run out of memory when I try to run this code?
I am trying to write a neural network that will train on plays by Shakespeare and then write its own passages. I am using pytorch. For some reason, my GPU ...
3
votes
1
answer
110
views
How to specify version for dependencies so that each one is compatible and stays within a size limit?
I am trying to deploy a web app to Heroku. The free tier is limited to 500 MB.
I am using my resnet34 model as a .pkl file.
I create model with it using the fastai ...
1
vote
0
answers
225
views
Why does the learning rate influence whether i get a error from BCE or not? [closed]
When I use a learning rate higher than 0.001, I get this:
Assertion `input_val >= zero && input_val <= one` failed.
This means that the input I gave ...
2
votes
1
answer
1k
views
how to implement squared hinge loss in pytorch
does anyone have any advice on how to implement this loss in order to use it with a convolutional neural network?
Also, how should I encode the labels of my training data? We were using one hot ...
2
votes
1
answer
206
views
Colab can not connect to GPU from a python file [closed]
I am trying to run a github deep learning repository in Colab but I can not connect the python files to colab GPU.
I can connect to GPU when writing a script in the colab notebook e.g. when I run ...
1
vote
0
answers
73
views
Write way to add samples to torch TabularDataset
I have a TabularDataset and i would like to add some examples to the dataset.
...
1
vote
0
answers
59
views
Replacing VGG by LeNet Caffe model
this code works with a VGG caffe model (VGG_ILSVRC_19_layers.caffemodel).
When I tried to change the model to a LeNet caffemodel (below the prototxt file), I got the following error.
In 6 module of ...
4
votes
1
answer
5k
views
Does torch.cat work with backpropagation?
I was wondering if it was okay to use torch.cat within my forward function. I am doing so because I want the first two columns of my input to skip the middle hidden layers and go directly to the final ...
1
vote
1
answer
52
views
No loss decay while learning Neural Network for X-OR operation in torch
I have implemented a simple 1 hidden layer feed forward neural network in torch to learn X-OR operation. Below is my code:
...
1
vote
1
answer
110
views
Neural network accuracy in Torch depends on compute power?
I am new to machine learning and have quite good understanding of basic concepts.
I was implementing a 3 Layer neural network on MNIST dataset with 784, 100, 10 neurons in input, hidden, output layer ...
1
vote
1
answer
313
views
Torch on Gentoo
Has anyone tried to install Torch on top of Gentoo Linux Distribution?
I'm very familiar with this distribution, but I'm totally new at torch. Googling a little, I found that Gentoo is not officially ...
1
vote
1
answer
115
views
Unable to figure out nInputPlane in SpatialConvolution in torch?
Documentaion for Spatial Convolution define it as
module = nn.SpatialConvolution(nInputPlane, nOutputPlane, kW, kH, [dW], [dH], [padW], [padH])
nInputPlane: The ...
6
votes
2
answers
4k
views
How to handle Memory issues in training Word Embeddings on Large Datasets?
I want to train a word predictability task to generate word embeddings. The document collection contains 243k documents. The code implementation is in torch. I am struggling with the huge size of the ...
1
vote
0
answers
301
views
Multi-GPU, multi-machine computation with Torch
I know that Torch supports multi-GPU computation on the same machine (Example).
Is it possible to perform multi-GPU, multi-machine computations with Torch?