user_q stringlengths 3 20 | question stringlengths 20 31k | user_a stringclasses 5
values | answer stringlengths 18 302 |
|---|---|---|---|
StrausMG | Hi! I readthissection several times and tried to google my question, still cannot figure it out.My dataset is a tensor that fits in memory, so using batched indexing is much more efficient than indexing items one by one and collating them. Below, I provide two solutions I came up with, but is there a better way?Option ... | ptrblck | Both approaches would most likely work, although I think you could remove the DataLoader from the first approach and add shuffling manually, if wanted.
If you have already loaded the data into the RAM, you could directly get the samples via indexing or gather. |
Seo | Hi there, I am studying the Dropout implementation in PyTorch. The original paper says that" If a unit is retained with probability p during training, the outgoing weights of that unit are multiplied by p at test time"this in order to balance the greater number of active connections between the layers. Anyway I have ju... | ptrblck | PyTorch uses the inverse scaling during training, to avoid the operation during inference, which would yield the same overall result, and is mentioned in the dropout paper in section 10:
Another way to achieve the same effect is to scale up the retained activations by multiplying
by 1/p at traini… |
Sascha | So I’m working with time series data using a GRU and already explained a little bit about what I intend to do inthispost.But the short explaination is:I have data on users, which is basically a dataframe for each user, with each row representing a users activity in that minute. And i want to predict an event might occu... | ptrblck | Your example output seems to be a binary classification output, so you could use nn.BCELoss after applying sigmoid on your output.
However, to get more numerical stability I would recommend to let the model return raw logits and use nn.BCEWithLogits instead. This will also give you the ability to s… |
skyunyoo | Hello,I’m currently experiencing a CPU Memory shortage, so I would like to get help.I’m using about 400,0006464 (about 48G) and I have 32G GPU Memory.If I train using the codes below, the memory usage is over 90%.The code of my custom dataset is below.class trainDataset(torch.utils.data.Dataset):
def __init__(self,... | ptrblck | Thanks for the information!
Since you are loading each .npy in the Dataset.__init__ method, ConcatDataset will append all already initialized datasets and will thus use a huge amount of memory.
Would it be possible to create a loop over each '.npyfile and create a singletrainDatasetinside this loo… |
luminoussin | Hello, I am trying to find a way to save every visualization of conv2d activation layer in my model to learn the function on each part of my model. So far I have used the method on [Visualize feature map] (Visualize feature map) but this requires me to specify which module to visualize. I was thinking that I can use l... | ptrblck | You could iterate all modules, check if the current module is an nn.Conv2d modules, and register the hook using its name.
Here is a dummy code snippet for resnet:
model = models.resnet50()
for name, module in model.named_modules():
if isinstance(module, nn.Conv2d):
module.register_forw… |
billconan | I’m trying to use the pretrained vgg16 model provided by torchvision.But it seems that the expected input image is not a 3224224, as I got the following?RuntimeError: Expected 4-dimensional input for 4-dimensional weight 64 3 3 3, but got 3-dimensional input of size [3, 224, 224] insteadMy code:import torch
import torc... | ptrblck | The input is expected to have the shape [batch_size, channels, height, width]
You would have to add a batch dimension in dim0 via:
ran = ran.unsqueeze(0)
or initialize the batch dimension directly via:
ran = torch.rand((1, 3, 224, 224)) |
statstom | Given a tensor loaded with data, I am trying to convert it to CUDA and then forward it through a module that was loaded in CUDA.For example:input.to(torch::kCUDA);
vector<torch::jit::IValue> inputs;
inputs.emplace_back(input); //Input defined at at::Tensor that was .to(torch::kCUDA)
module.to(torch::kCUDA);
result = m... | ptrblck | Could you try to reassign input via:
input = input.to(torch::kCUDA);
and rerun the code, please? |
joshgiesbrecht | I’ve been working through the DCGAN tutorial and want to work with new datasets. I’ve brought in a grayscale set of Lego images, and while Icoulddo the sensible thing and figure out how to convert the network to operate with a single color channel, I realized it would bemuch funnierto make the Detector colorblind so th... | ptrblck | Your idea sounds like a fun project!Try to avoid the inplace operations and create a new tensor via:
f2 = f1.mean(1, keepdim=True)
and pass f2 to the discriminator. |
MJN | I am trying to implement a small CNN with PyTorch .I have changed the model.named_parameters() with other numbers, nothing else is changed. Could someone please help me with this issue? with the following logic, I updated the new weights.count=0for name,param in model.named_parameters():
print(type(param.data))
... | ptrblck | Numpy uses float64 as the default data type. If you load or create an array without changing this dtype, torch.from_numpy() will respect the dtype and will also return a DoubleTensor.
You should solve this issue by using:
param = torch.from_numpy(un_params[count][0]).float()
PS: the usage of the .… |
dvirginz | I am trying to call the\_\_getitem__function of my dataset once per batch due to the cost of each dataset query (on remote).class Dataset(Dataset):
def __init__(self):
...
def __len__(self):
...
def __getitem__(self, batch_idx): ------> here I get only one index
return self.wiki_d... | ptrblck | Maybe this code snippet might be helpful:
class MyDataset(Dataset):
def __init__(self):
self.data = torch.arange(100).view(100, 1).float()
def __getitem__(self, index):
x = self.data[index]
return x
def __len__(self):
return len(self.data)
… |
Sushruth_N | Can anyone suggest me on how to remove all RELU layers from Resnet model? And if possible replace by some linear function | ptrblck | Then you could replace it with nn.Identity() instead of another activation function. |
AreTor | What’s the easiest way to reset an optimizer stats, such as Adam’s moving averages, while keeping the same weights?To make an example, suppose I have a model and I have pretrained it on a dataset using Adam. Now, I want to reset Adam’s stats and train the model on another dataset, while keeping the same parameters to b... | ptrblck | If you have the optimizer instance, you should be able to get its attributes via:
optimizer.param_groups[0]['lr']
Your approach might work, but I would rather like to avoid manipulating the internal states. |
Dan_Sagher | Hi,I’m trying to improve performance and in order to do so I want to measure the accurate running time of different functions calls.Do anybody knows how to synchronize CUDA calls in Libtorch?In python you can do:torch.cuda.synchronize()Thanks! | ptrblck | This should work:
CUDAStream stream = getCurrentCUDAStream();
AT_CUDA_CHECK(cudaStreamSynchronize(stream)); |
aroibu1 | Hello all! After reading all the different posts on cross validation, and trying to fix my problem on my own, I decided to come and ask the community. In brief, my problem is as follows: when I try running cross validation on my 3D UNet, which I am currently testing using 10 epochs of training, I notice the following:K... | ptrblck | Thanks for the debugging.
As long as you recreate the optimizer, it should work.
You could check the optimizer.state_dict()['state'] for the running estimates. If they are not empty, something is wrong.
Otherwise, I agree that the result is looking unexpected, but the data might be the next thing… |
11179 | Hello Im new to deeplearningI want to test something so I want to make own convolution 2d method.I want to design as follows. kernel size = TGiving input Channel x H x W with kernel also Channel x T x T. Same as beforeBut each kernel with one multiplication gives output T x T not as a one number.So It is like kind of p... | ptrblck | You could try to manipulate the native conv2d implementation, but note that you won’t be able to manipulate the backend implementations from e.g. cudnn.
I’m also not sure, if that would be easier than to write out your operations manually.
The padding argument in nn.Conv2d can be simply added to t… |
Wei_Wong | I get a sample batch of data from dataloader, I set batch size to 1. The image shape is1 x 3 x 224 x 224, the label shape is 1 x 7 x 7 x 5. Now I tried to calculate the loss for one image, but i got the nan value, why? I also tried to train the network for whole batch, the loss is still nan. Thank you for reading.face... | ptrblck | In your bbox_regression_loss you are calculating the torch.sqrt of y_pred.
Did you make sure to not pass negative values to this method, as this will create NaN outputs? |
JakeAndFinn | I am using a trained model as an extractor in another model and it seems like it is working ok, but I don’t know if I am doing it right or now. So this is my model and how it is declared.class MyModel(nn.Module):
def __init__(self):
super(MyModel, self).__init__()
image_modules = list(ae_model.chil... | ptrblck | I assume that ae_model is an instance of ConvAutoencoder.
If that’s the case, note that self.modelA will only use the child modules of ConvAutoencoder and will not apply the functional API calls in its forward such as torch.relu and torch.sigmoid and will also use the max pooling layer once.
nn.Se… |
Tia | Hi, I met an out-of-memory error when I use closure in my new optimizer, which needs the value of the loss f(x) to update the parameters x in each iteration. The scheme is likeg(x) = f’(x)/f(x)x = x - a*g(x)So I define a closure function before optimizer.stepdef closure():
optimizer.zero_grad()
outputs = net(in... | ptrblck | I’m not sure how your new optimizer is defined, but e.g. LBFGS (which also requires a closure) can be memory intensive as stated in thedocs:
This is a very memory intensive optimizer (it requires additional param_bytes * (history_size + 1) bytes). If it doesn’t fit in memory try reducing the hi… |
JonOnEarth | Hi, I have some problems with fine-tuning the last layer of a Neural network.Code is as followed:for layer in self.layers[0:-1]:
for param in self.model.fc_layers[layer].parameters():
param.requires_grad = False
y_prime = self.model(X)
loss = self.model.criterion(y_prime, y... | ptrblck | Your general workflow should work as shown in this small example:
# Setup
model = models.resnet18()
data = torch.randn(1, 3, 224, 224)
target = torch.randint(0, 1000, (1,))
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.SGD(model.parameters(), lr=1e-3)
# Train
optimizer.zero_grad()
out … |
Daniel_Dsouza | Hi Everyone! I’m trying to use a Data Loader in the Pytorch Name Generator Tutorial. I’ve written a simple version of the Dataset and Dataloader, but I get a slightly different output with the Dataloader.from torch.utils.data import Dataset, DataLoader
class SampleDataset(Dataset):
def __init__(self):
temp... | ptrblck | I’m not sure I understand the question correctly.
The collate function gets the samples from multiple calls into Dataset.__getitem__ and creates a batch, which you will get in the DataLoader loop.
If you are fine with the current shape, then there is no need to write a custom collate function.
H… |
shamoons | Myconv moduleis:return torch.nn.Sequential(
torch.nn.Conv1d(
in_channels=in_channels,
out_channels=in_channels,
kernel_size=2,
stride=1,
dilation=1,
padding=1
),
torch.nn.ReLU(),
... | ptrblck | The output shape is given in theformula in the docs.
Based on this formula, the output is expected, as the layers will return:
L_out = math.floor((L_in + 2 * padding - dilation * (kernel_size - 1) - 1) / stride + 1)
# 1st layer
(24 + 2 * 1 - 1 * (2-1) - 1) / 1 + 1 = 25
# 2nd layer
(25 + 2 * 1 - … |
arjun_pukale | my torch version: 1.5.0+cu92my torchvision version: 0.6.0+cu92I have attached the screenshots of my folder structure and errorand I have also tried this on google colab with same folder structure and it works but its not working on my local system.imagefolder21209×955 94.6 KB | ptrblck | \t is an escape character and will add a tab to your string.
Try to use ./train_data instead. |
pyxiea | The code below is how I define the dataloadertrain_dataset = TweetDataset(
tweet=train_df.text.values,
sentiment=train_df.sentiment.values,
selected_text=train_df.selected_text.values
)
train_sampler = RandomSampler(train_dataset)
train_loader = DataLoader(train_dataset, samp... | ptrblck | Each call into the pseudo-random number generator will increase its state.
Your model creation is most likely calling into a the pseudo-random number generator at some point, which will make all following (random) calls different.
A simple code snippet is here:
torch.manual_seed(2809)
lin1 = nn.… |
iobtl | Hello all! I am trying to train a simple PyTorch model implemented from the Siamese CNN paper. The training runs just fine and all, but the run seems to terminate prematurely at the same iteration (254) each time I run it. There is no error code, and adding in a line of code to print the output each iteration shows no ... | ptrblck | Could you check the length of your DataLoader?
Maybe your training just finishes before reaching 10000 batches? |
Bruno_Oliveira | So, I have been reading a paper saying that VGG feature maps were rescaled by 1/12.75. I have two questions regarding this:I assume this just means that all weights and biases have been rescaled, am I right?The original paper was done using Theano and Lasagne. I wonder if the rescale factor would be different when usin... | ptrblck | In your approach you are only rescaling the final output activation of the base vgg model, while it seems that multiple activation maps are scaled and summed to the vgg loss in the paper:
We define the VGG loss based on the ReLU activation layers of the pre-trained 19 layer VGG network described i… |
ericrhenry | Certain optimizers, particularly those which have an internal iterative structure, require a LoopClosure object to their step() method. (LBFGS and perhaps some new-ish, relatively sophisticated optimizers come to mind.) In fact, the new Pytorch 1.5 API appears to now require an object of this sort be passed to Optimize... | ptrblck | The test providethis code snippet. Would that help? |
AhmadMoussa | I hope my title makes sense. I would like to know whether the following two snippets of code are equivalent or not:criterion = nn.MSELoss()
output = net(input)
loss = criterion(output, target)
loss.backward()Where output is an array of multiple values. Would the next snippet of code be identical?criterion = nn.MSELoss(... | ptrblck | The result should be the same, if you use the sum as the reduction type (reduction='sum' for nn.MSELoss).
Thus it depends also what reduction you are using in your custom loss function.
Here is an example code snippet using nn.CrossEntropyLoss.
Note that I called model.eval() to get the same outp… |
loskutak | Hi, I am trying to write custom loss function by creating a nn.module subclass with forward method.Is it possible to use pytorch reduction mode handling in my loss?Sure I can do:if reduction == 'mean':
return torch.mean(my_loss_value)
elif ...But I would rather just call something like:return torch_reduction_handling... | ptrblck | If I understand the use case correctly, you are looking for a generic “reduction” method, which would take the desired reduction type as an argument?
If so, then unfortunately PyTorch doesn’t provide this generic method.
You could pass a reduction argument to the functional calls of some criteria,… |
aditya_k | I am trying to return variable length array from Dataset, Dataloader is returning incorrect results.class TS(Dataset):
def __len__(self):
return 10
def __getitem__(self,idx):
return {'token':[1]*idx,'in':idx,'text':"hello"}
ds = TS()
dl = DataLoader(ds,batch_size=3,shuffle=False)
for... | ptrblck | You would need a custom collate function to use variable input shapes:
def my_collate(batch):
data = [item for item in batch]
return data
class TS(Dataset):
def __len__(self):
return 10
def __getitem__(self,idx):
return {'token':[1]*idx,'in':idx,'text':"he… |
Raul-Ronald_Galea | Hello,I have a dataset composed of 3D volumes, small enough to be loaded in memory.I need to process these volumes a batch of slices at a time (GPU memory restrictions)What would be a clean way to go about this?My current solution is subclassing torch.utils.data.Dataset to return one volume at a time, then getting slic... | ptrblck | This sounds like a valid approach.
Alternatively, you could of course create a tensor or list with all slices and use the index to grab a slice and create the desired batch from it, but I guess load_everything_in_memory might then become a bit more complicated.
You could try to use torch.utils.che… |
hadaev8 | I have very few data and want to store it all in gpu.Still it more than i can use in minibatch.What is best way to select random sub batch on every step? | ptrblck | You could randomly permute the indices and then slice the batch:
batch = torch.arange(10).view(10, 1)
# select 5 samples randomly
idx = torch.randperm(10)[:5]
mini_batch = batch[idx] |
sharvil | Suppose I have a (fake) module that looks like this:class MyLinearModule(nn.Module):
def __init__(self):
super().__init__()
self.mask = torch.ones(1, 100)
self.mask[:, :50] = 0
self.kernel = nn.Parameter(torch.rand(1, 100))
def forward(self, x):
return x @ (self.kernel * self.mask)This code is ... | ptrblck | Since mask is not trainable, you should register it as a buffer via:
mask = torch.ones(1, 100)
mask[:, :50] = 0.
self.register_buffer('mask', mask)
This will make sure to push it to the right device as is done with parameters. |
Ameen_Ali | Let’s say I have a tensor of shape a = [Batchsize , 80 , 2048].and I have another mask tensor of shape b = [Batchsize] containing 0 , 1. I want to remove the element i from tensor a which satisfy b[i] = 1 , and keep the other tensors in the same order.so far I did it in for loops, but I’m sure there is another fast way... | ptrblck | You could index a by keeping all samples, which meet the requirement b!=1:
a = torch.randn([10, 80, 2])
b = torch.randint(0, 2, (10,))
res = a[b!=1] |
rakshit_naidu | Hello, I’m quite new to Pytorch. I was wondering how I could convert my tensor of sizetorch.Size([1, 3, 224, 224])to display in an image format on a Jupyter notebook. A PIL format or a CV2 format should be fine.I tried usingtransforms.ToPILImage(x)but it resulted in a different format like this:ToPILImage(mode=ToPILIma... | ptrblck | ToPILImage() should work.
I’m not sure what you are passing as the mode argument, but this small code snippet works fine:
x = torch.randn(1, 3, 224, 224)
trans = torchvision.transforms.ToPILImage()
out = trans(x[0])
out.show() |
cedricchan | I encountered this problem when training with multi gpu after a few epochs. Sometimes the error is “Segmentation fault (core dumped)”.My pyTorch version is 1.4.0, cuda version is 10.1.terminate called after throwing an instance of 'c10::Error'
what(): invalid device pointer: 0x7f3872000000 (free at /pytorch/c10/cuda... | ptrblck | Could you install the latest nightly binary and rerun the code, please? |
tvdhout | Hi all!I have two datasets, dataset 1 has ±400 samples and dataset 2 ±1000 samples. I want to train my network such that it sees one sample from dataset 1 for every 5 samples of dataset 2 (roughly).With a batch size of 32, each batch containing 5 samples from dataset 1 and 27 from dataset 2 would work. How would I go... | ptrblck | One approach would be to create separate DataLoaders with batch_size=5 (small dataset) and =27 (large dataset), respectively.
In the outer loop you would iterate the large dataset to make sure you are sampling all data points.
You could create an iterator for the small dataset via small_iter = ite… |
jubick | Let’s say i have tensor A of shape (1024) and tensor B of shape (5,20,1024) and tensor B contains tensor A.How can i find index of tensor A in tensor B? | ptrblck | This should work:
a = torch.zeros(1024)
b = torch.randn(5, 20, 1024)
b[2, 17].fill_(0.)
idx = (a == b).all(dim=2).nonzero() |
murphinator | I performed transfer learning on a VGG-16 and re-trained the classifier portion. Training worked, the predictions work. However, I am puzzled as to why when I continue to run a prediction on the same image file, the prediction oscillates between two classifications that are very similar to each other. I must have forgo... | ptrblck | You might have forgotten to call model_transfer.eval(), which will disable dropout and will use the running stats in batchnorm layers instead of the current batch stats.
Let me know, if that’s the case or if you are still seeing shaky outputs. |
entslscheia | A common practice of developing neural models is to define a subclass ofnn.Modulewith both__init__function andforwardfunction inside it. Then we can create an instancemodelof the class we defined and callforwardfunction directly usemodel(...). I have never questioned this before, until I found a PyTorch project on GitH... | ptrblck | If you define an nn.Module, you are usually storing some submodules, parameters, buffers or other arguments in its __init__ method and write the actual forward logic in its forward method.
This is a convenient method as nn.Module.__call__ will register hooks etc. and call finally into the forward m… |
PrudviRaj_J | I encountered this error for the below code snippet.definit(self, original_dim, projection_dim, n_modalities=2):super().init()self.C = []
self.n_modalities = n_modalities
for _ in range(n_modalities):
# C tensor performs the mapping of the h vector and stores the s vector values as well
C = tor... | ptrblck | If self.C[i] returns a tensor, you would have to reassign the result of to:
self.C[i] = self.C[i].to(device) |
sgaur | HII just want to know while creating the Inception Network “BasicConv2d” why author implemented with forward block inside classBasicConv2dwhy cant’t we use just a Function as defined below nameddef conv3x3??Is there any special need to define classBasicConv2d(nn.Module)instead ofdef conv3x3.class BasicConv2d(nn.Module... | ptrblck | Yes, this should return the nn.Sequential container with the specified modules. |
Muhsinka | data_transforms = {‘train’: transforms.Compose([transforms.RandomResizedCrop(224),transforms.RandomHorizontalFlip(),transforms.ToTensor(),transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]),‘val’: transforms.Compose([transforms.Resize(224),transforms.CenterCrop(256),transforms.ToTensor(),transforms.Nor... | ptrblck | Either change in_features=387200 in self.fc1 as posted before.
Alternatively you could add more conv/pooling operation to reduce the spatial size of the activation or pass a smaller input tensor to the model.
The current shape is defined by your input shape and the conv/pool layers. |
Valerio_Biscione | Hello. I was trying to understand the architecture of VGG19_bn and I stumbled upon something interesting.After the convolution layers, there is an adaptive average pooling(7,7). My understanding is that 7x7 is the requested output of the average pooling. However, the feature maps that feed into the average pooling are... | ptrblck | The adaptive pooling layers were added to relax the condition on specific input shapes.
By default a lot of models are trained on images of [batch_size, 3, 224, 224].
As you said, for this shape the original architecture should be used.
However, if you would like to increase the spatial size to e… |
hktxt | Hey, guysI trained a image segmentation model and want to do inference using libtorch. The model predict a mask with a input image.捕获1794×265 45.4 KBI traced the model for later C++ usage.#define CV_8UC3 CV_MAKETYPE(CV_8U,3)
#include <torch/script.h> // One-stop header.
#include <iostream>
#include <memory>
#include<op... | ptrblck | Thanks for the update!
The current output still looks as if the copying of the data is running into a row/columns mismatch.
You see these diagonal “edges”, which would correspond to the desired width, but are shifted in each row.
I would recommend to check the shape of the output, the created Ope… |
saty_101 | I am trying to load in MNIST dataset and although I know that there are many different ways to do so, I am having trouble in loading the dataset via the following method -#image_location is already there in the variable path_digit[]
for i in range(10):
print("check")
stacked_training[i] = torch.stack([tensor(Image.... | ptrblck | How did you define path_digit?
The torchvision.datasets.MNIST dataset uses the internal data attribute to load all images from the downloaded binary files, so I’m not sure how you extracted the paths.
EDIT: Seems to be solved inthis topic. |
Shanto_Islam | I know this error is common but I am unable to solve this specific problem. I’ve checkedthistopic and have both the concern checked-marked which were about label_size and vocab_size. It would be glad if anyone could point out the problem. Stuck for 2 days already. It started to show up when I tuned a pre-trained fastTe... | ptrblck | How did you increase the input tensor?
Could you check its min and max values and compare it to the shape of the embedding matrix? |
shreyas_kamath | Hi,I have been trying to implement a custom batch normalization function such that it can be extended to the Multi GPU version, in particular, the DataParallel module in Pytorch. The custom batchnorm works alright when using 1 GPU, but, when extended to 2 or more, the running mean and variance work in the forward funct... | ptrblck | Answered inthis topic. |
AndreTeixeira | I’m training a model to classify 14 different plants using resnet101, but 3 of them are decreasing the accuracy of my model. I’ve trained a model especific for classify these 3 plants and then i got a good precision on it. Is there a way to use this new “3 problematic plants model” in the original 14 plants classificat... | ptrblck | You could try to create a staged classifier, where the first level would classify each sample into the “easy” and “hard” classes, and call the corresponding model.
However, you would of course have to retrain this model and would have to compare it to the standard approach of a single model.
I wou… |
PTA | I have a model that was written using models from torchvision and I wanna test the performance with inception-v3. However, with the same model structure and imput images (size 224 x 224), I got the following error.RuntimeError: Calculated padded input size per channel: (3 x 3). Kernel size: (5 x 5). Kernel size can't b... | ptrblck | Inception-v3 needs an input shape of [batch_size, 3, 299, 299] instead of [..., 224, 224].
You could up-/resample your images to the needed size and try it again. |
lepoeme20 | Hi,After calculating the FLOPS of the model (GAN), I found a strange point.I compared following two cases:1. Conv2d(kernel_size=3, stride=1, padding=1)
2. ConvTranspose2d(kernel_size=4, stride=2, padding=1)The dimensions of the input channel and output channel are the same as 1024 and 512 respectively.And my computatio... | ptrblck | The number of parameters seems to be correct and you could simply verify it via:
nb_params = conv.weight.nelement() # + conv.bias.nelement() (you can skip the bias, as it's insignificant compared to the weights)
Since your transposed convolution uses a stride of 2, the kernels will be applied to l… |
shivin7 | I am porting a net from Keras to Pytorch, however the training in Pytorch doesn’t seem to learn anything. The net is trying to learn sub-word embeddings in a phrase and classify it among three classes.The architecture (along with output shapes) of the net is as follows :Embedding Layer (batch x 200 x 128)Convolution La... | ptrblck | That might be the case and I agree that something else might create the issue.
In the Keras implementation you are using return_sequences=False.
Based on the docs, it seems that this LSTM will only return the output of the last timestep.
In your PyTorch implementation you are reshaping the outpu… |
jmaronas | Hello.As far as I nowloss.backward()only works iflossis a single scalar value. I am considering a loss function that is not implemented in pytorchhttps://arxiv.org/pdf/1905.09670.pdf(equation 5) and I want to avoid numerical problems.I know that a way to stabilize the softmax + log score loss is to compute the derivati... | ptrblck | This should create the same gradients.
I’ve used this simple dummy snippet to verify it:
# Setup
torch.manual_seed(2809)
model = nn.Sequential(
nn.Conv2d(3, 6, 3, 1, 1),
nn.ReLU(),
nn.Conv2d(6, 1, 3, 1, 1),
nn.ReLU(),
nn.Flatten(),
nn.Linear(1*24*24, 10)
)
x = torch.randn… |
thancaocuong | Hi, I’ve tried to set CUDA_VISIBLE_DEVICES = ‘1’ in main function but when I move the model to cuda, It does not move to GPU1 but GPU0 instead (result in OOM due to GPU0 is in use). Please tell me if I’m wrong.here is my code:in train.py:def main(config_file_path):
config = SspmYamlConfig(config_file_path)
dat... | ptrblck | If all devices are the same, use
CUDA_VISIBLE_DEVICES=1,2 python script.py args
to run the script and inside the script use cuda:0 and cuda:1 (or the equivalent .cuda(0), .cuda(1) commands).
However, if the mapping is not what you expect via nvidia-smi, you could force the PCI bus order order via… |
Bruce_zhuang | I would like to ask a question that I thought Pytorch has taken care of, but it has not.Well, the main loop for training a network is likeoutputs = model(images)
loss = F.cross_entropy(outputs, labels)
optimizer.zero_grad()
loss.backward()
optimizer.step()I thought that the parameter update process (optimizer.step()) w... | ptrblck | I think the main design decision for this behavior is, because the gradient calculation and the update steps are independent from each other.
E.g. you can easily accumulate gradients with multiple forward/backward passes, if a larger batch doesn’t fit in your memory.
Also, you might work with mult… |
nas | Hi,I am training a very simple CNN. While training everything goes well, but when it comes to testing I am gettingRuntime errorfor not having enough memory! I am new in using PyTorch! I am posting the testing portion of the code below, any help will be highly appreciated!loss_function = nn.MSELoss()
net.eval()
Variable... | ptrblck | Could you wrap your testing code into a with torch.no_grad() block?
This would avoid storing the intermediate tensors, which would be needed to calculate the gradients in the backward pass.
Also, you might want to define a training and validation function, if that’s not already the case.
Since Py… |
WaterKnight | I am getting the previous error when I use the following line of code:model=torchvision.models.segmentation.deeplabv3_resnet50(pretrained=True) | ptrblck | This model was added 8 days ago inthis PR, so you could install the nightly binary or build from source to use it. |
Pymal | I’m new to pytorch and I would like to design the following model:“Generate Graph” building block is not part of the network and it just generates a graph using featuresfevery batch. I also want the loss function to be end-to-end.In fact I know how to design a network with two separate parts (EncoderandGCN) but I canno... | ptrblck | That would be possible, if e.g. you are multiplying f with A or use any other differentiable operation. |
khshim20 | Hi.While trying named tensors,I found torch.Tensor have attribute ‘name’.It prints None, and also is not writable.I think there is no documentation for this…Can you help me understand what ‘name’ does? | ptrblck | Based onthis commentit seems tensor.name is currently used in ONNX (but I’m not sure how and where). |
jack_ma | Hi, I’ve read this tutorialhttps://pytorch.org/tutorials/advanced/cpp_extension.html.But I feel weird about the speed result.image1176×454 27.9 KBIt says CUDA-based C++ code is slower than custom CUDA kernel. The two method both run codes on cuda device in c++ with the same operator. Why there is a speed gap between th... | ptrblck | As described in the tutorial, the next step after writing the extension is to write a custom CUDA kernel and reduce the kernel launch overheads:
A definite method of speeding things up is therefore to rewrite parts in C++ (or CUDA) and fuse particular groups of operations. Fusing means combining… |
charmander1 | When I started feeding data through my Pytorch net, I got this error:RuntimeError: non-empty 3D or 4D input tensor expected but got ndim: 4.This is my net:class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 32, 5, 1)
self.conv2 = nn.Conv2d(32, 64, ... | ptrblck | This error would be raised, if you pass an empty tensor to the pooling layer as shown here:
pool = nn.MaxPool2d(2)
x = torch.randn(1, 3, 24, 24)
out = pool(x) # works
y = torch.tensor([[[[]]]])
out = pool(y)
> RuntimeError: non-empty 3D or 4D input tensor expected but got ndim: 4
Could you check … |
Deb_Prakash_Chatterj | I am getting this error -output = model.forward(images)
---> 90 conf_matrix = confusion_matrix(output, labels, conf_matrix)
91 p = torch.nn.functional.softmax(output, dim=1)
92 prediction = torch.argmax(p, dim=1)
50 preds = torch.argmax(preds, 1)
51 for p, t in zip(preds, labels):
-... | ptrblck | Make sure to replace the last linear layer with a new nn.Linear using out_features = 39.
Different models use different attributes for the last layer(s), e.g. model.fc, model.classifier etc. |
Felix_Labelle | I’m trying to profile code using the bottleneck util. RunningCUDA_VISIBLE_DEVICES=2 python3 -m torch.utils.bottleneck /root/mount/Matterport3DSimulator/scripts/multimodal_filter.py --mode eval --batch_size 3000 --checkpoint best_model.pt, gives the following error:image1898×445 28.9 KBThe class its referring to is a cl... | ptrblck | Did you store the complete model or its state_dict?
The latter case is recommended, but I haven’t seen this particular issue with the former approach yet, so not sure, if this might cause the error. |
maaft | While copying the parameter named "toolbox_modules.backbone.kx", whose dimensions in the model are torch.Size([3, 3, 3, 3]) and whose dimensions in the checkpoint are torch.Size([3, 3, 3, 3]Err… what?Hier is my module definition:self.kx = nn.Parameter(torch.tensor([[1, 0, -1],
... | ptrblck | That’s not a very helpful message.
The error comes from the expanded parameter inside your model and you could avoid it by calling .contiguous() on it or use repeat instead of expand.
Also, since your parameter does not require gradients, you could register a buffer instead (via self.register_buff… |
ecdrid | I have a model where the forward pass has something like the below.............
.............
all_feats, _ = self.rnn(sequence_output)
conved = all_feats.unsqueeze(1)
conved = F.relu(self.conv(conved))
conved = conved.squeeze()
conved = conved.permute(0, 2, 1) # -- it bl... | ptrblck | I assume the conved.squeeze() might remove unwanted dimensions during inference, since coved has only two dimensions after the squeeze.
I’m not sure, which dimensions you would like to squeeze in this line of code, but note that all dimensions with size==1 will be removed.
If you are using a batch… |
carlstronaut | Hello,I’m just wondering what the best practice is regarding storing models/model params together with e.g. classification metrics for that particular model. | ptrblck | The recommended way is storing the state_dicts as described in theserialization docs.
Often a dict is stored with all state_dicts and other attributes as shown in theImageNet example. |
gt_tugsuu | Is it okey to convert tensor to numpy and calculate the loss value, and convert that value to tensor and backpropagate? | ptrblck | That won’t work as you are detaching the computation graph by calling numpy operations.
Autograd won’t be able to keep record of these operations, so that you won’t be able to simply backpropagate.
If you need the numpy functions, you would need to implement your own backward function and it shoul… |
EpsAvlc | I am trying to construct a network in paperSegMap: 3D Segment Mapping using Data-Driven Descriptors. When I ran my model, the loss didn’t change and was 7.542.Here is the model’s structure:Screenshot from 2020-04-14 11-29-591293×302 98.1 KBI am trying to construct the network in blue and green boxes.(the Descriptor ex... | ptrblck | Which criterion are you using?
If you are dealing with a multi-class classification use case, I assume you are using nn.CrossEntropyLoss.
If that’s the case, note that this loss function expects raw logits, since internally F.log_softmax and nn.NLLLoss will be applied, so you should remove the sof… |
jitesh | I am building an Autoencoder where I need to encode an image into a latent representation of length 100. I am using the following architecture for my model.self.conv1 = nn.Conv2d(in_channels = 3, out_channels = 32, kernel_size=3)
self.conv2 = nn.Conv2d(in_channels=32,out_channels=64,kernel_size=3,stride=2)
... | ptrblck | Even though you are defining a valid Resize transformation, you are not applying the transformation in your CustomDataset, but instead but use ToTensor().
If your images have different spatial size, this shape mismatch error will be raised. |
calebh | I have created a very simple transformer model using PyTorch, but when I train the loss does not decrease during training as expected. I attempted to figure out where the cause was by feeding a single example to the transformer over and over again. I expected the transformer to quickly overfit, however what happens ins... | ptrblck | nn.CrossEntropyLoss uses F.log_softmax and nn.NLLLoss internally.
Since you are using softmax as your last activation, note that log_softmax will be applied on these activations again in the criterion.
Could you remove the softmax and rerun the code, please? |
jbarry | I have quite a basic question but I could not find a similar question answered elsewhere.I would like to add two tensors within a larger tensor. Specifically, I have a tensor of shape(batch, seq_len, max_len, embedding_dim)and I want to add all of the tensors inmax_lenso that I am left with(batch, seq_len, embedding_di... | ptrblck | I’m not sure, if I misunderstand the question, but would a.sum(2) work?
This would apply the sum operation in dim2. |
braindotai | I’m runningfrom torch.cuda.amp import GradScaler, autocastand got the error as in title.Pytorch version: - 1.4.0Thanks. | ptrblck | torch.cuda.amp is available in the nightly binaries, so you would have to update. |
alx | I was looking at the tensor shape of the following cnn:def __init__(self):
super().__init__() # just run the init of parent class (nn.Module)
self.conv1 = nn.Conv2d(1, 32, 5)
self.conv2 = nn.Conv2d(32, 64, 5)
self.conv3 = nn.Conv2d(64, 128, 5)
def convs(self, x):
x ... | ptrblck | As explained in thedocs, the output shape will be calculated by a final floor operation.
Since 19/2 = 9.5, the output shape of 9 is thus expected. |
Jordan_Howell | Hello,I’m trying to sample from the Student T distribution.I use the following code:m = StudentT(torch.tensor([4846]))
m.sample()That is derived from the docs:https://pytorch.org/docs/stable/distributions.htmlHere is the error in and the traceback:------------------------------------------------------------------------... | ptrblck | Pass the degrees of freedom as a float or FloatTensor and it should work. |
Kamil_Kwiatkowski | Hi, how would I go about visualising the result ofpytorch.stftsimiliar to scipy?I don’t entirely understand how can I use that output to achieve a similiar plot:Screenshot from 2020-04-12 15-01-281197×571 77.3 KB | ptrblck | Ah OK, sure.
Adapting the scipy example:
fs = 10e3
N = 1e5
amp = 2 * np.sqrt(2)
noise_power = 0.01 * fs / 2
time = np.arange(N) / float(fs)
mod = 500*np.cos(2*np.pi*0.25*time)
carrier = amp * np.sin(2*np.pi*3e3*time + mod)
noise = np.random.normal(scale=np.sqrt(noise_power),
… |
William_yang | Hi, I am a starter of Pytorch. I want to implement a multi-wavelet function as an activation function. However, I don’t know how to set a function in this module.`class MultiWavelet(nn.Module):def __init__(self,out_features):
super(MultiWavelet, self).__init__()
self.out_features = out_features
self.scale =... | ptrblck | Could you remove the numpy() call from self.c and rerun the code?
Generally, if you don’t need to use another lib, I would recommend to use PyTorch methods only.
This will make sure that Autograd is able to keep track of all operations and create the backward pass for you automatically.
If you ne… |
zhryang | Hi, everyone,When I writing cpp extension using cudnn_convolution_backward, I meet Cudnn Error. My cpp extension looks like this:#include <torch/extension.h>
#include <ATen/NativeFunctions.h>
#include <ATen/Config.h>
#include <cstdio>
#include <iostream>
#include <array>
at::Tensor conv2d(
const at::Tensor& input... | ptrblck | There are a couple of issues in the code:
the CUDNN_STATUS_BAD_PARAM error is raised, since you are passing padding[0] and padding[1] before the strides, while your conv2d_backward expects the opposite
You are returning an std::tuple of three at::Tensors, while at::cudnn_convolution_backward r… |
benjs | Hello PyTorch-Community,i am very new to PyTorch and I try to getthisSegmentaton Network running on my Notebook with Geforce GTX 1650. I’d be glad if you can give me hints.The following error occurs:RuntimeError: CUDA out of memory. Tried to allocate 450.00 MiB (GPU 0; 3.82 GiB total capacity; 2.08 GiB already allocate... | ptrblck | The intermediate tensors, which are needed to calculate the gradients, the gradients themselves, as well as the CUDA context will all use memory on your device, which could explain the OOM issue.
You could try to decrease the batch size, if possible, and check the memory usage for a smaller batch … |
KarthikR | Hi,I have an multi-label classification problem. There are 4 targets (500 observations each, for the first three labels and 50 observations for the fourth label). The loss function is cross entropy.I use pretrained model (ResNet18) in Pytorch.Case 1:When I use train_test_split from sklearn (with stratify) and use it as... | ptrblck | In your first case, the loss might decrease fast, if your model simply overfits the majority class(es), thus ignoring the minority class.
You could calculate the confusion matrix for both use cases and calculate the per-class accuracies to rate both approaches.
Note that a simple accuracy calculat… |
csailnadi | I am wondering how I can useregister_hookto modify filters gradients for the convolutional layer.Say my convo layer has 10 filters, 3 channels, 5x5 --> (10, 3, 5, 5).Each 32x32 filter should have its own gradient e.g G.I have the corresponding tensor of the size (10, 3, 5, 5) where 5x5 matrix M is a matrix that I want... | ptrblck | If your already have a tensor in the shape [10, 3, 5, 5], where the 5x5 tensors correspond to the mask, you can simply multiply the gradient with this tensor. There is no need to loop over each mask. |
csailnadi | I am wondering what I am doing wrong with register_hook since it does not seem to register a hook.My goal is to modify grad matrix before weights are updated. For debugging purposes I just assigned zero matrix for a grad variable, but network trains perfectly.So clearly hooks don’t work, but I cannot figure why. Here i... | ptrblck | I think your code registers the hooks too late (after the backward call).
Note that the hook will be called during the gradient calculation.
You could register the hooks during setup and use the standard training loop without removing and adding the hooks again. |
csailnadi | I am registering hooks to update convolutional layer in this wayfor i, conv_layer in enumerate(model.convos):
conv_layer.weight.retain_grad()
print("conv_layer.weight.shape ", conv_layer.weight.shape)
print("Ms[i].shape ", Ms[i].shape)
h = conv_layer.weight.register_hook(lambda grad: convo_g... | ptrblck | Python uses lexical scoping so that the closure will use the name and scope of the passed variable i.
To fix this issue, you could pass i to the lambda as:
conv_layer.weight.register_hook(lambda grad, i=i: dummy(i)) |
braindotai | Let’s say I wanna build a custom metric, so in that case, I could just simply just write a function and use accordingly in my training loop.Can I rather define metric as a class inherited fromnn.Moduleand there define the forward method for the metric definition?I know I can, but is it beneficial in any way (if it is) ... | ptrblck | If your metric is stateless (i.e. you don’t want to store arguments or other parameters), then you could just define a method. Otherwise, a custom class derived from nn.Module could store some arguments e.g. reductions as an internal attribute.
Also, have a look atthis postI’ve written some time … |
abbaahmad | Using the exampleherefor my RoI Pooling layer of Faster RCNN, I keep encountering a runtime error: “expected input to have non-empty spatial dimensions, but has sizes [1,512,7,0] with dimension 3 being empty”. I need any guidance i can about how to resolve this error as I can’t find anything helpful about it.Feature ma... | ptrblck | Some layer might decrease the spatial size of the activation, such that it results in an empty tensor.
As@charan_Vjysuggested, print the shape of the input directly before passing it to the adaptive pooling layer. |
dexen | Hi,I have a rather unique situation I believe (I searched online for hours but couldn’t find a solution).I have a network with 2 types of input:One is an image (say, 254x254), and one is a pair of integers (coordinates in the image).Some background:I’d like to train a binary classification network with the inputs being... | ptrblck | Would splitting the Datasetsinto anImageDatasetandCoordDataset` work?
You could then use the nested loop approach and keep the image constant in the inner loop.
Pseudo code for the idea:
image_loader = DataLoader(image_dataset)
coord_loader = DataLoader(coord_dataset)
for image in image_loader:
… |
shamoons | I have a tensor,predwhich has a.sizeoftorch.Size([8, 28, 161]). I want it to match the shape ofoutputs, which has a.sizeoftorch.Size([8, 27, 161]), so I’m doing:pred = torch.nn.functional.interpolate(outputs, size=outputs.size())But this gives me an error:File "train_reconstruction.py", line 204, in main
pred = tor... | ptrblck | F.interpolate applies the interpolation in the temporal/spatial/volumetric dimensions.
In your case it would accept a single value:
x = torch.randn(8, 28, 161)
out = F.interpolate(x, size=140)
print(out.shape)
> torch.Size([8, 28, 140])
Since you want to interpolate in the channel dimension, you … |
wenlongzhao094 | What are the usage of padding_idx for nn.Embedding? It seems that the vector at padding_idx will be initialized as zeros. Also this vector is not trained. But when is it used for padding?What happens when we do not set a padding_idx?What happens when we do not set a padding_idx but still have at the beginning of the v... | ptrblck | If padding_idx is set, the output tensor will contain all zeros at the position, where the input tensor had the padding_idx.
You could use it to ignore specific inputs without the need to remove these index from your input tensor. |
Soka_David | Simple custom activation function causes CUDA out of memory.Tags: Custom Activation Function, Memory Usage, CUDA out of memoryProblemI am trying to implement a very simple activation function that turns every value that is higher than 1 to 1. I did the following:def zolu(input):
input[input>1] = 1
return input
... | ptrblck | You could try to replace the indexing of input with input = torch.clamp(input, max=1), which might reduce the memory footprint.
Let me know, if that helps. |
xksteven | How to print out the tensor type without printing out the whole tensor? | ptrblck | In the latest stable release (0.4.0) type() of a tensor no longer reflects the data type.
You should use tensor.type() and isinstance() instead.
Have a look at theMigration Guidefor more information. |
jubick | I get this errorRuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [5, 100]] is at version 1; expected version 0 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was ... | ptrblck | Thanks for the code.
The offending call should be the inplace unsqueeze of prototypes[0].
Change it to this and it should work:
dist = M_2 - self.distance_function(x_in, prototypes[0].unsqueeze(0)) |
darek.kleczek | @ptrblck_deI’m getting started with Pytorch and your posts on this forum helped me SO MUCH!!! I really wanted to appreciate it! If there’s a way to do something virtually as a token of gratitude (e.g. donation etc.) please let me know! Hope you’re safe, have a great day! Cheers, Darek | ptrblck | Hi Darek,
haha thanks, but no need to buy me a drink!Welcome to the community and it would make me happy to see some posts of you here! |
hongjunchoi | torch forum11183×449 13.1 KBAbove is my code for trying to fix, freeze the subset(temp_5.values ) of 25th convolution layer’s filter. And the result.I try to set the subset filter’s gradient as 0 so not to update. And the weight has been changed.So two questionsI wonder why the gradient becomes not zero?Is there other... | ptrblck | momentum would be such an internal state, which uses the previous gradients to update the parameters even with a zero gradients.
Here is a small example showing this behavior:
# Setup
model = nn.Conv2d(1, 10, 3, 1, 1)
weight_reference = model.weight.clone()
optimizer = torch.optim.SGD(model.parame… |
braindotai | I’m trying to select values out of a tensor based on in indices stored in another tensor.outputs = torch.FloatTensor([[0.3, 0.7], [0, 1], [0.4, 0.6]])
labels = torch.Tensor([0, 1, 1]).long()I want to select based on labels as indices at the 1st dimension. So I want outputs to betorch.tensor[[0.3], [1], [0.6]].I tried t... | ptrblck | torch.gather should do the job:
outputs = torch.FloatTensor([[0.3, 0.7], [0, 1], [0.4, 0.6]])
labels = torch.Tensor([0, 1, 1]).long()
print(outputs.gather(1, labels.unsqueeze(1)))
>tensor([[0.3000],
[1.0000],
[0.6000]]) |
shamoons | I’m attempting to give me data more temporal understanding. To do that, I want to pad only the left side with each successive layer so that I’ll maintain the same shape, but progressively “roll up” information from the older / earlier elements. Is this possible with PyTorch? | ptrblck | You could leave padding=0 in the conv layers and use F.pad in the forward method to pad one-sided. |
shamoons | I have a problem where I want to get a compressed representation of some high-dimensional data. So normally, I would train an autoencoder to get that representation. But I don’t actually need the decoder, so is it possible for me to have the autoencoder training in my main loop?For my AE, I’d want to use MSE loss and f... | ptrblck | You could split your autoencoder into the encoder and decoder part and then train all modules together.
Here is a dummy example:
encoder = MyEncoder()
decoder = MyDecoder()
z = encoder(data)
out = decoder(z)
loss_z = criterion_z(z, target_z)
loss_out = criterion_out(out, target_out)
loss = loss_… |
zzsunshine | Hi all,I try to train a model by using multi-GPUs on single machine. And I want to figure out how the multiple GPUs connect with each other, (I mean the shape of the connection, full connect? in parallel? or in series?Thanks! | ptrblck | If you want to check how the devices are connected inside your machine, you could run nvidia-smi topo -m in your terminal.
I might have misunderstood the question, but nn.DataParallel replicated the model on each device as explainedhere. |
DanielL | Hi, I’m having a problem specific to GPU. This code works in cpu, but yields “Child terminated with signal 11” when executed in GPUThe class I have is as the following:class CustomLSTM(torch.nn.Module):
def __init__(self, input_size=100, embedding_dict_size=466553, batch_size = 25, hidden_size=30, output_dim=2, num... | ptrblck | Thanks for the code!I got an error of a device mismatch, since hidden_state and cell_state are both initialized on the CPU even if you push the model to the GPU.
Could you try to use:
def forward(self, X):
X = self.embedding(X)
trans_X = X.transpose(0, 1) # Make it … |
danielfllaneza | I keep having this recurrent problem when instantiating my model for the second time when performing k-fold cross validation.The model is initialised with the following hyperparameters:input_size = 150
hidden_size = 256
embedding_dimensions = 512
num_layers = 2
cell_type = 'LSTM'
embedding_dropout = 0.0
dropout = 0.0
l... | ptrblck | Since you are reassigning self.embedding_dropout to nn.Dropout(p = self.embedding_dropout), the next call will create this error.
Could you use another name for the attributes, e.g.:
self.embedding_dropout = nn.Dropout(p = self.embedding_dropout_p) |
barakb | Hi i’m trying to load my data using:trainset = datasets.ImageFolder(root=traindir, transform=train_transform)
trainloader = torch.utils.data.DataLoader(trainset,
batch_size=args.batch_size,
shuffle=True,
... | ptrblck | The symbolic link on the left exists, but points to a non-existing file.
Note that the left file does not contain the image. It’s just a link to the real file, which is missing. |
AladdinPerzon | From my understanding it’s ok to reuse nn.Relu and nn.Maxpool in the forward because they don’t have trainable parameters. I’m not entirely sure of why this works, perhaps someone can clarify this for me. Let’s say I haveclass NN(nn.Module):
def __init__(self, input_size, num_classes):
super(NN, self).__ini... | ptrblck | You can reuse parameter-less modules, as only the computation will be tracked.
A theoretical example would be reusing nn.Add(a, b) instead of a + b. |
Nanachi | Update, the problem is solved.if you encounter with the same issue, try using .contiguous() as following example from@ptrblckptrblck:x= F.max_pool1d(x.transpose(1,2).contiguous(), kernel_size=x.size()[1])Hi all,I did slight change on a nn by adding a max_pool1d and get error tracebackTraceback (most recent call last):... | ptrblck | Thanks for the code snippet.
Since it’s not reproducible with the last code, could you try to use:
x= F.max_pool1d(x.transpose(1,2).contiguous(), kernel_size=x.size()[1])
and rerun the script, please?
Also, which PyTorch version are you using?
Make sure to update to the latest stable release, a… |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.