All Questions
1,571 questions
1
vote
1
answer
40
views
How to perform global structured pruning in PyTorch
I am training on CIFAR10 the following simple CNN
class SimpleCNN(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 32, kernel_size=3, padding=1)
...
0
votes
1
answer
60
views
Image rotation: model for angle detection using pytorch
Basically I am trying to create a model that will detect angle on which a specific image is rotated. Also I have a dataset of 1500 documents resulting with images rotated on
random.sample([0, 90, -90, ...
0
votes
0
answers
64
views
how to apply backward warp (pytorch's grid_sample) with forward optical flow?
I have been working on optical flow algorithms recently and have been using pytorch to apply the optical flow field.
I have noticed that most libraries have implemented only the backward warp function ...
0
votes
1
answer
45
views
TypeError: Dataloader object is not subscriptable
I'm creating an AI model to generate density plots of crowds. When splitting the dataset into two, one for training and one for validation, I create the two data sets and try to load the datasets ...
2
votes
0
answers
33
views
Conversion of model weights from old Keras version to Pytorch
I want to transfer pretrained weights from an old project on github : https://github.com/ajgallego/staff-lines-removal
The original Keras model code is:
def get_keras_autoencoder(self, input_size=256, ...
0
votes
1
answer
62
views
Using zip() on two nn.ModuleList
Is using two different nn.ModuleList() zipped lists correct to build the computational graph for training a neural net in PyTorch? nn.ModuleList is a wrapper around Python's list with a registration ...
0
votes
2
answers
90
views
Regression fails with poor initial guess [closed]
Consider a regression task where the parameters of the model differ significantly in magnitude, say:
def func(x, p):
p1, p2, p3 = p
return np.sin(p1*x) * np.exp(p2*x) * p3
# True Parameters:
...
0
votes
0
answers
29
views
Data loading for neural network memory optimization
def load_training_data(pgn_file = 'lichess_elite_2022-02.pgn', max_games = 140000):
data = []
with open(pgn_file) as a:
for i in range(max_games):
game = chess.pgn.read_game(a)
...
1
vote
0
answers
46
views
Error When Using Batch Size Greater Than 1 in PyTorch
I'm building a neural network to predict how an image will be partitioned during compression using VVC (Versatile Video Coding). The model takes a single Y-frame from a YUV420 image as input and uses ...
1
vote
1
answer
96
views
Why does my Llama 3.1 model act differently between AutoModelForCausalLM and LlamaForCausalLM?
I have one set of weights, one tokenizer, the same prompt, and identical generation parameters. Yet somehow, when I load the model using AutoModelForCausalLM, I get one output, and when I construct it ...
1
vote
0
answers
67
views
Runtime Error while trying to train RTDetrV2 with Transformer
I am trying to train RTDetrV2 for detection on water meter digit. I use an ipynb file form here https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/train-rt-detr-on-...
0
votes
0
answers
52
views
Stable torch, ultralytics, tensorflow packages for requirements.txt
I'm writing a requirements.txt for a real-time sports video analysis project and testing various libraries such as YOLOv8, Torch, TensorFlow, etc.
I've tried multiple Python versions but encountered ...
2
votes
0
answers
109
views
Using binary ({0,1}) weights in a Neural Network layer [closed]
I want to create a custom linear (not fully connected) layer in Pytorch. What is special in this layer is that I need its weights to be binary (0 or 1), so that this layer acts as a "mask", ...
0
votes
0
answers
56
views
Autoencoder for multi-label classification task
I'm working on a multi-label classification problem using an autoencoder-based neural network built in PyTorch. The overall idea of my approach is as follows:
I load my dataset from a CSV file, ...
0
votes
1
answer
45
views
Why facing "CUDA error: device-side assert triggered" while training LSTM model?
I am learning Pytorch and deep learning, I am working on a dataset containing 4-features. My problem statement is multiclass classification problem, total 9 possible output 1 to 9.
Gene which is ...