Skip to main content
Filter by
Sorted by
Tagged with
3 votes
2 answers
57 views

on Python 3.13, torch 2.10.0+cu130 import torch loss = nn.CrossEntropyLoss() loss(torch.tensor((.1, .2)), torch.tensor((.3, .4))) returns - tensor(0.4811) but why does nn.CrossEntropyLoss(torch....
user2309803's user avatar
1 vote
0 answers
43 views

I am training a small PyTorch model and want to use nn.BatchNorm1d. When the batch size is 1 and the model is in training mode, I get the error below; ValueError: Expected more than 1 value per ...
Linda's user avatar
  • 37
0 votes
0 answers
36 views

I trained a CycleGAN model on Google Colab using this repository - https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix The model should enhance dark images. I tested the model on my test dataset ...
rupertpurple's user avatar
0 votes
0 answers
50 views

I am currently working on a project where I have to use GluonTS (the DeepAREstimator and DLinearEstimator). At the beginning it worked well. But now, even when I use the example code from the GluonTS ...
peter mafai's user avatar
2 votes
2 answers
51 views

If I run a py module with only these imports (no additional code) it works fine and the output is Process finished with exit code 0: import torch.utils.data from torch.utils.data.dataloader import ...
Takewood's user avatar
0 votes
0 answers
28 views

I got a pretrained resnet 18 model from this lane detection repo in order to use it as an ADAS(advanced driver assistance systems) function for an electric car making competition. My current goal is ...
Ekim's user avatar
  • 3
0 votes
0 answers
31 views

I am implementing a Reinforcement Learning environment using torchrl where the agent uses an LSTM-based policy. My goal is to train the agent on sequences sampled from a replay buffer. While I have ...
wittn's user avatar
  • 318
0 votes
0 answers
45 views

I'm trying to train a character-level GRU on Linux kernel source but the training loop keeps crashing with this error: RuntimeError: view size is not compatible with input tensor's size and stride (...
user avatar
1 vote
1 answer
63 views

I am utilizing PyTorch for federated experiments. As my experiments involves 50 datasets with models, so, I have to run multiple ML models experiments parallelly. The code for training ML model is ...
Sultan Ahmed Sagor's user avatar
0 votes
0 answers
35 views

I have a Dataset that is based on IterableDataSet, looking like that class MyDataSet(torch.utils.data.IterableDataset): def __init__(self): # doing init stuff here def __iter__(self): ...
RaJa's user avatar
  • 1,597
Advice
2 votes
2 replies
46 views

# Example of target with class indices loss = nn.CrossEntropyLoss() input = torch.randn(3, 5, requires_grad=True) <=============== WHY ? target = torch.empty(3, dtype=torch.long).random_(5) output =...
VISHMA PRATIM DAS's user avatar
6 votes
0 answers
109 views

About I am trying to create a Docker image with the same Dockerfile with Python 3.10, CUDA 12.8, and PyTorch 2.8 that is portable between two machines: Local Machine: NVIDIA RTX 5070 (Blackwell ...
requiemman's user avatar
0 votes
0 answers
116 views

I am currently on a project to segment 3D-LSM images using self-supervised model and i have been trying to perform a dryrun(testing pre-training) on the AMD GPU droplet on digitalocean. the configs of ...
Manav Patel's user avatar
1 vote
1 answer
47 views

I'm learning GPU programming with PyTorch and I'm confused about when torch.cuda.synchronize() is actually necessary. I have this code that compares CPU and GPU matrix multiplication: import torch ...
nz_21's user avatar
  • 7,821
-1 votes
0 answers
27 views

I am implementing a custom activation function (a variant of Swish) in PyTorch to optimize memory usage. I implemented it using torch.autograd.Function by defining both the forward and backward static ...
Satish Soni's user avatar

15 30 50 per page
1
2 3 4 5
1593