xingyizhou / pytorch-pose-hg-3d

PyTorch implementation for 3D human pose estimation
GNU General Public License v3.0
614 stars 143 forks source link

s = min(s, max(img.shape[0], img.shape[1])) * 1.0 AttributeError: 'NoneType' object has no attribute 'shape' #79

Open monajalal opened 4 years ago

monajalal commented 4 years ago

Could you please help me with the following?

Running the demo on a single image did not give me any error.

[jalal@goku POSE_ROOT]$ python src/main.py --exp_id test --task human3d --dataset fusion_3d --load_model models/fusion_3d_var.pth --test --full_test
USE_TENSORBOARD:  False
heads {'hm': 16, 'depth': 16}
=> using msra resnet 'msra_50'
=> loading pretrained model https://download.pytorch.org/models/resnet50-19c8e357.pth
loaded models/fusion_3d_var.pth, epoch 10
==> initializing 3D val data.
Loaded 3D val 19312 samples
#Images2D 0, #Images3D 19312
testTESTTraceback (most recent call last):
  File "src/main.py", line 103, in <module>
    main(opt)
  File "src/main.py", line 59, in main
    log_dict_train, preds = val(0, opt, val_loader, model)
  File "/scratch3/3d_pose/humanpose/POSE_ROOT/src/lib/train_3d.py", line 147, in val_3d
    return step('val', epoch, opt, val_loader, model)
  File "/scratch3/3d_pose/humanpose/POSE_ROOT/src/lib/train_3d.py", line 38, in step
    for i, batch in enumerate(data_loader):
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 336, in __next__
    return self._process_next_batch(batch)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
AttributeError: Traceback (most recent call last):
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/scratch3/3d_pose/humanpose/POSE_ROOT/src/lib/datasets/fusion_3d.py", line 34, in __getitem__
    return self.dataset3D[index]
  File "/scratch3/3d_pose/humanpose/POSE_ROOT/src/lib/datasets/h36m.py", line 96, in __getitem__
    s = min(s, max(img.shape[0], img.shape[1])) * 1.0
AttributeError: 'NoneType' object has no attribute 'shape'
pulkitsharma38 commented 4 years ago

Hi @monajalal . I am facing the same error during training. Did you solve this error?

lvandoit commented 4 years ago

hi,Did you solve this error? @pulkitsharma38

imistyrain commented 4 years ago

check your data path

funihang commented 4 years ago

I have the same error.