Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from pieterwolfert/master
Browse files Browse the repository at this point in the history
pytorch compatibility fix
  • Loading branch information
weigq authored Apr 10, 2019
2 parents da503fe + 71535da commit a03094b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 3d_pose_baseline_pytorch

A PyTorch implementation of a simple baseline for 3d human pose estimation.
You can check the origin Tensorflow implementation written by [Julieta Martinez et al.](https://github.com/una-dinosauria/3d-pose-baseline).
Some codes for data processing are brought from the origin version, thanks to the authors.
You can check the original Tensorflow implementation written by [Julieta Martinez et al.](https://github.com/una-dinosauria/3d-pose-baseline).
Some codes for data processing are brought from the original version, thanks to the authors.

<!-- ![demo](./img/demo.jpg) -->

Expand Down Expand Up @@ -32,7 +32,7 @@ This is the code for the paper
## Dependencies

* ~~[h5py](http://www.h5py.org/)~~
* [PyTorch](http://pytorch.org/) >= 3.0.0
* [PyTorch](http://pytorch.org/) >= 1.0.0

## Installation

Expand Down Expand Up @@ -85,7 +85,7 @@ This is the code for the paper
### Test
1. You can download the [pretrianed model](https://drive.google.com/file/d/1NUY8oZoLKY9DP63Jg_ZE96_DEJKiVvRp/view?usp=sharing) on ground-truth 2d pose for quick demo.
1. You can download the [pretrained model](https://drive.google.com/file/d/1NUY8oZoLKY9DP63Jg_ZE96_DEJKiVvRp/view?usp=sharing) on ground-truth 2d pose for a quick demo.
```
python main.py --load $PATH_TO_gt_ckpt_best.pth.tar --test
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def train(train_loader, model, criterion, optimizer,
# calculate loss
optimizer.zero_grad()
loss = criterion(outputs, targets)
losses.update(loss.data[0], inputs.size(0))
losses.update(loss.item(), inputs.size(0))
loss.backward()
if max_norm:
nn.utils.clip_grad_norm(model.parameters(), max_norm=1)
Expand Down Expand Up @@ -218,7 +218,7 @@ def test(test_loader, model, criterion, stat_3d, procrustes=False):
outputs_coord = outputs
loss = criterion(outputs_coord, targets)

losses.update(loss.data[0], inputs.size(0))
losses.update(loss.item(), inputs.size(0))

tars = targets

Expand Down

0 comments on commit a03094b

Please sign in to comment.