karfly / learnable-triangulation-pytorch

This repository is an official PyTorch implementation of the paper "Learnable Triangulation of Human Pose" (ICCV 2019, oral). Proposed method archives state-of-the-art results in multi-view 3D human pose estimation!
MIT License
1.09k stars 181 forks source link

Issue running evaluation #96

Closed jamalknight closed 4 years ago

jamalknight commented 4 years ago

Once training was done, I ran evaluation by editing:

/experiments/human36m/eval/human36m_vol_softmax.yaml (by adding weights path)

  init_weights: true
  checkpoint: "/media/jamal/jknight_3TB/projects/learnable-triangulation-pytorch/logs/human36m_vol_softmax_VolumetricTriangulationNet@25.06.2020-21:02:23/checkpoints/0054/weights.pth"

Then I run:

python3 train.py \
  --eval --eval_dataset val \
  --config experiments/human36m/eval/human36m_vol_softmax.yaml \
  --logdir ./logs

But got this error:

args: Namespace(config='experiments/human36m/eval/human36m_vol_softmax.yaml', eval=True, eval_dataset='val', local_rank=None, logdir='./logs', seed=42)
Number of available GPUs: 0
Loading pretrained weights from: ./data/pretrained/human36m/pose_resnet_4.5_pixels_human36m.pth
Traceback (most recent call last):
  File "train.py", line 483, in <module>
    main(args)
  File "train.py", line 404, in main
    }[config.model.name](config, device=device).to(device)
  File "/media/jamal/jknight_3TB/projects/learnable-triangulation-pytorch/mvn/models/triangulation.py", line 233, in __init__
    self.backbone = pose_resnet.get_pose_net(config.model.backbone, device=device)
  File "/media/jamal/jknight_3TB/projects/learnable-triangulation-pytorch/mvn/models/pose_resnet.py", line 341, in get_pose_net
    pretrained_state_dict = torch.load(config.checkpoint, map_location=device)
  File "/home/jamal/anaconda3/envs/learnable_triangulation_1/lib/python3.6/site-packages/torch/serialization.py", line 368, in load
    return _load(f, map_location, pickle_module)
  File "/home/jamal/anaconda3/envs/learnable_triangulation_1/lib/python3.6/site-packages/torch/serialization.py", line 542, in _load
    result = unpickler.load()
  File "/home/jamal/anaconda3/envs/learnable_triangulation_1/lib/python3.6/site-packages/torch/serialization.py", line 505, in persistent_load
    data_type(size), location)
  File "/home/jamal/anaconda3/envs/learnable_triangulation_1/lib/python3.6/site-packages/torch/serialization.py", line 388, in restore_location
    return default_restore_location(storage, str(map_location))
  File "/home/jamal/anaconda3/envs/learnable_triangulation_1/lib/python3.6/site-packages/torch/serialization.py", line 114, in default_restore_location
    result = fn(storage, location)
  File "/home/jamal/anaconda3/envs/learnable_triangulation_1/lib/python3.6/site-packages/torch/serialization.py", line 95, in _cuda_deserialize
    device = validate_cuda_device(location)
  File "/home/jamal/anaconda3/envs/learnable_triangulation_1/lib/python3.6/site-packages/torch/serialization.py", line 79, in validate_cuda_device
    raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.

My machine does have a GPU, any ideas why it's not recognising it?

karfly commented 4 years ago

torch.cuda.is_available() is False means that PyTorch doesn't use your GPU.

jamalknight commented 4 years ago

A simple restart fixed the issue.