Naman-ntc / Pytorch-Human-Pose-Estimation

Implementation of various human pose estimation models in pytorch on multiple datasets (MPII & COCO) along with pretrained models
MIT License
474 stars 75 forks source link

Issue with Training #4

Closed prathmeshrmadhu closed 5 years ago

prathmeshrmadhu commented 5 years ago

I have followed the steps as your README file explains. However, when I am running the model, I am getting the following errors. Could you please help?

 The Model chosen for training is : DeepPose
==> initializing 2D train data.
/localhome/prathmeshmadhu/work/2019/Pytorch-Human-Pose-Estimation/data/mpii/worldCoodstrain.mat
/localhome/prathmeshmadhu/work/2019/Pytorch-Human-Pose-Estimation/data
Loaded 2D train 22246 samples
==> initializing 2D val data.
/localhome/prathmeshmadhu/work/2019/Pytorch-Human-Pose-Estimation/data/mpii/worldCoodstrain.mat
/localhome/prathmeshmadhu/work/2019/Pytorch-Human-Pose-Estimation/data
Loaded 2D val 2958 samples
==>Traceback (most recent call last):
  File "main.py", line 37, in <module>
    Trainer.train(TrainDataLoader, ValDataLoader, Epoch, opts.nEpochs)
  File "/localhome/prathmeshmadhu/work/2019/Pytorch-Human-Pose-Estimation/trainer.py", line 27, in train
    train = self._epoch(traindataloader, epoch)
  File "/localhome/prathmeshmadhu/work/2019/Pytorch-Human-Pose-Estimation/trainer.py", line 77, in _epoch
    output = model(data)
  File "/localhome/prathmeshmadhu/.virtualenvs/dl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/localhome/prathmeshmadhu/work/2019/Pytorch-Human-Pose-Estimation/models/DeepPose.py", line 16, in forward
    return self.resnet(x)
  File "/localhome/prathmeshmadhu/.virtualenvs/dl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/localhome/prathmeshmadhu/.virtualenvs/dl/lib/python3.6/site-packages/torchvision/models/resnet.py", line 162, in forward
    x = self.fc(x)
  File "/localhome/prathmeshmadhu/.virtualenvs/dl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/localhome/prathmeshmadhu/.virtualenvs/dl/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 67, in forward
    return F.linear(input, self.weight, self.bias)
  File "/localhome/prathmeshmadhu/.virtualenvs/dl/lib/python3.6/site-packages/torch/nn/functional.py", line 1352, in linear
    ret = torch.addmm(torch.jit._unwrap_optional(bias), input, weight.t())
RuntimeError: size mismatch, m1: [16 x 512], m2: [2048 x 32] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:266
Naman-ntc commented 5 years ago

Hi, Thanks for using! I fixed the bug, it should work now. Please pull again and try once! Reopen if it doesn't solve the issue

prathmeshrmadhu commented 5 years ago

Thanks for your quick response. Now it works.