Coder Social home page Coder Social logo

kennymckormick / pyskl Goto Github PK

View Code? Open in Web Editor NEW
885.0 12.0 171.0 2.17 MB

A toolbox for skeleton-based action recognition.

License: Apache License 2.0

Python 99.28% Shell 0.11% Jupyter Notebook 0.61%
action-recognition deep-learning skeleton-based-action-recognition stgcn posec3d gesture-recognition pytorch

pyskl's Introduction

PYSKL

PWC PWC PWC [Report]

PYSKL is a toolbox focusing on action recognition based on SKeLeton data with PYTorch. Various algorithms will be supported for skeleton-based action recognition. We build this project based on the OpenSource Project MMAction2.

This repo is the official implementation of PoseConv3D and STGCN++.


Left: Skeleton-base Action Recognition Results on NTU-RGB+D-120; Right: CPU Realtime Skeleton-base Gesture Recognition Results

Change Log

  • Improve skeleton extraction script (PR). Now it supports non-distributed skeleton extraction and k400-style (2023-03-20).
  • Support PyTorch 2.0: when set --compile for training/testing scripts and with torch.__version__ >= 'v2.0.0' detected, will use torch.compile to compile the model before training/testing. Experimental Feature, absolutely no performance warranty (2023-03-16).
  • Provide a real-time gesture recognition demo based on skeleton-based action recognition with ST-GCN++, check Demo for more details and instructions (2023-02-10).
  • Provide scripts to estimate the inference speed of each model (2022-12-30).
  • Support RGBPoseConv3D, a two-stream 3D-CNN for action recognition based on RGB & Human Skeleton. Follow the guide to train and test RGBPoseConv3D on NTURGB+D (2022-12-29).

Supported Algorithms

Supported Skeleton Datasets

Installation

git clone https://github.com/kennymckormick/pyskl.git
cd pyskl
# This command runs well with conda 22.9.0, if you are running an early conda version and got some errors, try to update your conda first
conda env create -f pyskl.yaml
conda activate pyskl
pip install -e .

Demo

Check demo.md.

Data Preparation

We provide HRNet 2D skeletons for every dataset we supported and Kinect 3D skeletons for the NTURGB+D and NTURGB+D 120 dataset. To obtain the human skeleton annotations, you can:

  1. Use our pre-processed skeleton annotations: we directly provide the processed skeleton data for all datasets as pickle files (which can be directly used for training and testing), check Data Doc for the download links and descriptions of the annotation format.
  2. For NTURGB+D 3D skeletons, you can download the official annotations from https://github.com/shahroudy/NTURGB-D, and use our provided script to generate the processed pickle files. The generated files are the same with the provided ntu60_3danno.pkl and ntu120_3danno.pkl. For detailed instructions, follow the Data Doc.
  3. We also provide scripts to extract 2D HRNet skeletons from RGB videos, you can follow the diving48_example to extract 2D skeletons from an arbitrary RGB video dataset.

You can use vis_skeleton to visualize the provided skeleton data.

Training & Testing

You can use following commands for training and testing. Basically, we support distributed training on a single server with multiple GPUs.

# Training
bash tools/dist_train.sh {config_name} {num_gpus} {other_options}
# Testing
bash tools/dist_test.sh {config_name} {checkpoint} {num_gpus} --out {output_file} --eval top_k_accuracy mean_class_accuracy

For specific examples, please go to the README for each specific algorithm we supported.

Citation

If you use PYSKL in your research or wish to refer to the baseline results published in the Model Zoo, please use the following BibTeX entry and the BibTex entry corresponding to the specific algorithm you used.

@inproceedings{duan2022pyskl,
  title={Pyskl: Towards good practices for skeleton action recognition},
  author={Duan, Haodong and Wang, Jiaqi and Chen, Kai and Lin, Dahua},
  booktitle={Proceedings of the 30th ACM International Conference on Multimedia},
  pages={7351--7354},
  year={2022}
}

Contributing

PYSKL is an OpenSource Project under the Apache2 license. Any contribution from the community to improve PYSKL is appreciated. For significant contributions (like supporting a novel & important task), a corresponding part will be added to our updated tech report, while the contributor will also be added to the author list.

Any user can open a PR to contribute to PYSKL. The PR will be reviewed before being merged into the master branch. If you want to open a large PR in PYSKL, you are recommended to first reach me (via my email [email protected]) to discuss the design, which helps to save large amounts of time in the reviewing stage.

Contact

For any questions, feel free to contact: [email protected]

pyskl's People

Contributors

alexandermelde avatar kennymckormick avatar mikuugithub avatar nacriema avatar sunyuhan19981208 avatar yuta1125tp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyskl's Issues

Can't run python demo/demo_skeleton.py demo/ntu_sample.avi demo/demo.mp4

/pyskl-main$ python demo/demo_skeleton.py demo/ntu_sample.avi demo/demo.mp4

Traceback (most recent call last):

File "demo/demo_skeleton.py", line 16, in

from pyskl.apis import inference_recognizer, init_recognizer

ModuleNotFoundError: No module named 'pyskl'

when I run the demo_skeleton.py, it wrong

run python demo/demo_skeleton.py demo/ntu_sample.avi command successfully, but generated video can't be played.

`(pyskl) dong@dong-HP-Z1-Entry-Tower-G6:~/Code/Pyskl/pyskl$ python demo/demo_skeleton.py demo/ntu_sample.avi demo/demo.mp4
load checkpoint from local path: .cache/joint_f6bed715.pth
load checkpoint from http path: http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth
Performing Human Detection for each frame
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 72/72, 11.9 task/s, elapsed: 6s, ETA: 0sload checkpoint from http path: https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth
Performing Human Pose Estimation for each frame
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 72/72, 13.9 task/s, elapsed: 5s, ETA: 0sload checkpoint from http path: https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth
Moviepy - Building video demo/demo.mp4.
Moviepy - Writing video demo/demo.mp4

Moviepy - Done !
Moviepy - video ready demo/demo.mp4
`
Its' seems fine, but the generated video can't be played normally. It's just a black screen, stucked at 00:00.

Single GPU error

I really appreciate the work presented, Congratulations!

However, I encounter a problem when I run dist_train.sh with a single GPU.
Running the following line:
bash tools/dist_train.sh configs/posec3d/slowonly_r50_ntu120_xset/joint.py 1 --validate --test-last --test-best

The error follows:

ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: -9) local_rank: 0 (pid: 50075) of binary: /usr/bin/python3
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launch.py", line 193, in <module>
    main()
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launch.py", line 189, in main
    launch(args)
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launch.py", line 174, in launch
    run(args)
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/run.py", line 715, in run
    elastic_launch(
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launcher/api.py", line 131, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launcher/api.py", line 245, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
======================================================
tools/train.py FAILED
------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2022-04-20_11:31:39
  host      :  *******
  rank      : 0 (local_rank: 0)
  exitcode  : -9 (pid: 50075)
  error_file: <N/A>
  traceback : Signal 9 (SIGKILL) received by PID 50075
======================================================

Info about my machine:

sys.platform: linux
Python: 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
CUDA available: True
GPU 0: NVIDIA GeForce RTX 3070
CUDA_HOME: /usr/local/cuda
NVCC: Build cuda_11.6.r11.6/compiler.31057947_0
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
PyTorch: 1.11.0+cu113
PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.5.2 (Git Hash a9302535553c73243c632ad3c4c80beec3d19a1e)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.3
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
  - CuDNN 8.2
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.11.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, 

TorchVision: 0.12.0+cu113
OpenCV: 4.5.5
MMCV: 1.4.8
MMCV Compiler: n/a
MMCV CUDA Compiler: n/a
pyskl: 0.1.0+f2cefec

Can't run python demo/demo_skeleton.py demo/ntu_sample.avi demo/demo.mp4

load checkpoint from http path: https://download.openmmlab.com/mmaction/pyskl/ckpt/posec3d/slowonly_r50_ntu120_xsub/joint.pth
load checkpoint from http path: http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth
Performing Human Detection for each frame
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 72/72, 20.9 task/s, elapsed: 3s, ETA: 0sload checkpoint from http path: https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth
Performing Human Pose Estimation for each frame
[ ] 0/72, elapsed: 0s, ETA:Traceback (most recent call last):
File "demo/demo_skeleton.py", line 314, in
main()
File "demo/demo_skeleton.py", line 258, in main
pose_results = pose_inference(args, frame_paths, det_results)
File "demo/demo_skeleton.py", line 184, in pose_inference
pose = inference_top_down_pose_model(model, f, d, format='xyxy')[0]
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmcv/utils/misc.py", line 340, in new_func
output = old_func(*args, **kwargs)
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmpose/apis/inference.py", line 380, in inference_top_down_pose_model
poses, heatmap = _inference_single_pose_model(
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmpose/apis/inference.py", line 247, in _inference_single_pose_model
data = test_pipeline(data)
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmpose/datasets/pipelines/shared_transform.py", line 107, in call
data = t(data)
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmpose/datasets/pipelines/top_down_transform.py", line 289, in call
c = results['center']
KeyError: 'center'

I can't run pose_infererce ,but the frame_paths and det_results are not none,I don't know where is wrong.

Why does the pyskl use so much GPU memory?

Does the data pipeline, for example the train_pipeline in "configs/stgcn++/stgcn++_ntu60_xview_3dkp/j.py", use GPU? The pyskl occupies more GPUs memory than mmaction2, at least 2 times.

Generating Pseudo Headmap Volumes

Hello there!!
Thank you very much for such great work!
Could you please let me know where I can find "GenPseudoHeadmaps.ipynb"?

Thank you very much in advance

#Rank issue

when I run tools/data/custom_2d_skeleton.py file, I get the following error:
Traceback (most recent call last):
File "./tools/data/custom_2d_skeleton.py", line 172, in
main()
File "./tools/data/custom_2d_skeleton.py", line 119, in main
init_dist('pytorch', backend='nccl')
File "/home/ubuntu/miniconda3/envs/aiguard1/lib/python3.7/site-packages/mmcv/runner/dist_utils.py", line 40, in init_dist
_init_dist_pytorch(backend, **kwargs)
File "/home/ubuntu/miniconda3/envs/aiguard1/lib/python3.7/site-packages/mmcv/runner/dist_utils.py", line 51, in _init_dist_pytorch
rank = int(os.environ['RANK'])
File "/home/ubuntu/miniconda3/envs/aiguard1/lib/python3.7/os.py", line 681, in getitem
raise KeyError(key) from None
KeyError: 'RANK'

Dependencies:
python 3.7
pytorch 1.11
cudatollkit 11.3
mmcv-full 1.5.0
mmdet 2.24.0
-Use single GPU
Can anyone give me some idea to solve this? Thanks!

About the format of "viodes_list" in the custom_2d_skeleton.py

Hello, Ph.D. Duan. I want to konw the format of the "--videos_list" for the whole dataset. for example: UCF101, they have many folders with multiple labels, according to the comments is it necessary to put them all on one line? Could you give me a sample, please?

test with single GPU error

sir,when i test with single GPU,the error is KeyError :"val" and KeyError:"PoseDataset: 'val". My command is bash tools/dist_test.sh configs/posec3d/slowonly_r50_diving48/joint.py work_dirs/posec3d/slowonly_r50_diving48/joint/latest.pth 1 --out yaml/testwork.json --eval top_k_accuracy mean_class_accuracy thanks for you!

How can i look at the plots losses?

I want to watch changing train loss and validation loss, example wandb or just simple plots. How i can do that? This framework provides such an opportunity?
Thanks

some questions about the pretrained 2d model in resnet3d

Hi, Kenny. Thank you for sharing such excellent work.

Recently, I am learning the ResNet3dSlowOnly in pyskl .

I feel confused about the parameter pretrained2d(bool): Whether to load pretrained 2D model. Default: True, In class ResNet3d of models/cnns/resnet3d.py.

  1. In the original code, self.pretrained2d = True, I think it means you use the pretrained 2D model. However I can't find the loaded pretrained 2D model and I don't know where the pretrained
    model is loaded (torchvision? or other places? I can't find the relative code to appoint it).

  2. If I set pretrained2d = False, Can I still train normally? Will the final result be much worse than when loading the pretrained 2D model?

Sincerely hope to get your reply!

training epochs confuse

training epoch of PoseC3D is different in config(24 epochs) and readme(240 epochs), is that a typo?

fail to run demo

hi i have already installed mmcv-full 1.3.14, but it report that
image
furthermore, when i check mmcv-full following the mmcv instructions, there is no failure report at all.
image

PoseC3D configuration about SlowFast network

Hi, it's really an amazing job! I really like it. But I didn't find the config about using SlowFast network (there is only SlowOnly network configuration). So could you offer a script about that? Thank you so much!

How to apply the "spatial augmenatations" in the config file?

In your released paper, i found that the result in table 1 and table 4 is different, does the difference originate from the "spatial augmenatations" (like random rotation or scaling) mentioned in the paper? Can you please tell me how to apply random rotation or scaling in the config file?

detection model error in demo

i tried demo_posec3d with st-gcn++ that was trained with ntu60 dataset.
but i got detection error although i download det-checkpoint. detection model is still nontype
image
i don't know the reason..

Can't

When I run /tools/data/custom_2d_skeleton.py,there has a problem
File "tools/data/custom_2d_skeleton.py", line 176, in
main()
File "tools/data/custom_2d_skeleton.py", line 123, in main
init_dist('pytorch', backend='nccl')
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmcv/runner/dist_utils.py", line 18, in init_dist
_init_dist_pytorch(backend, **kwargs)
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmcv/runner/dist_utils.py", line 29, in _init_dist_pytorch
rank = int(os.environ['RANK'])
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/os.py", line 675, in getitem
raise KeyError(key) from None
KeyError: 'RANK'

I can't find RANK from "os.environ['RANK']",so I change 'LOCAL_RANK' to 'RANK',but there has other problem,about that:
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 224, in _env_rendezvous_handler
world_size = int(_get_env_or_raise("WORLD_SIZE"))
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 203, in _get_env_or_raise
raise _env_error(env_var)
ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable WORLD_SIZE expected, but not set

who solved this question,please give some advises,Thank you very much!

How to set ids of GPUs to use

Hi, I use 2 GPUs when training the model, but I find that by default I can only use GPU 0 and 1. If I want to train on GPU 2 and 3, where do I need to set ids of GPUs to use

what is the command to test with single gpu?

sir,my test command is bash tools/dist_test.sh configs/posec3d/slowonly_r50_diving48/joint.py work_dirs/posec3d/slowonly_r50_diving48/joint/latest.pth 1 --out yaml/testwork.json --eval top_k_accuracy mean_class_accuracy, and it will occur two errors, the first is KeyError: 'val'. the second is KeyError: "PoseDataset: 'val'" . i dont know how to solve, my test command is wrong?

another error about extracting the skeleton of diving48

Hi!Kenny! Thank you for sharing such excellent work!I have met another error when extracting the skeleton of diving48. I felt very confused.

I can run demo successfully.

However, when I run custom_2d_skeleton.py, there is an error about init_detector and init_pose_model

If I use the original code
28)}MGM ~V1%D7I9O38HL$D

If I modify the default_det_config and default_det_ckpt according demo_skeleton.py
2NQTO43_B7`261ZRRU}D7)D

I really don't know how to solve the problem, if anyone meet the same problem like me , please help me, thank you.

demo_posec3d

Hi!
We tried to execute demo_posec3d, but there is a problem with init_detector.
The result of init_detector model is None type.
So model.CLASS[0] also has no value.
How can I solve this problem??
image

where are configs of RGB+Pose?

I am sorry that I cannot find configs of RGB+Pose models that there should be two paths. But in configs/posec3d I can only find configs that only take pose as inputs, i.e., one path, the input channel is 17. Could you help me with that? Thanks.

webcam_demo code

Thanks for great repository !!!
I'd like to appreciate it if webcam_demo code will be added soon.

what is the command to train with single GPU on diving48?

sir,what is the command to train with single GPU?My command is bash tools/dist_test.sh configs/posec3d/slowonly_r50_diving48/joint.py work_dirs/posec3d/slowonly_r50_diving48/joint/latest.pth 1 --out yaml/testwork.json --eval top_k_accuracy mean_class_accuracy , the error is KeyError 'val'.

Extracting 2D Poses Using diving48_example.ipynb

Hello,

Thank you for sharing this great repository. I want to train and test the model on other datasets, however when I use diving48_example.ipynb to extract pose data from Diving48 based on your instructions I encounter this error:

ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: -11) local_rank: 0 (pid: 234913) of binary: /usr/bin/python3.8
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/galinezh/.local/lib/python3.8/site-packages/torch/distributed/launch.py", line 193, in
main()
File "/home/galinezh/.local/lib/python3.8/site-packages/torch/distributed/launch.py", line 189, in main
launch(args)
File "/home/galinezh/.local/lib/python3.8/site-packages/torch/distributed/launch.py", line 174, in launch
run(args)
File "/home/galinezh/.local/lib/python3.8/site-packages/torch/distributed/run.py", line 715, in run
elastic_launch(
File "/home/galinezh/.local/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 131, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/home/galinezh/.local/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 245, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

/home/galinezh/pyskl/tools/data/custom_2d_skeleton.py FAILED

Failures:
[1]:
time : 2022-06-13_23:04:55
host : coe54000151lws.dyn.uncc.edu
rank : 1 (local_rank: 1)
exitcode : -11 (pid: 234914)
error_file: <N/A>
traceback : Signal 11 (SIGSEGV) received by PID 234914
[2]:
time : 2022-06-13_23:04:55
host : coe54000151lws.dyn.uncc.edu
rank : 2 (local_rank: 2)
exitcode : -11 (pid: 234915)
error_file: <N/A>
traceback : Signal 11 (SIGSEGV) received by PID 234915
[3]:
time : 2022-06-13_23:04:55
host : coe54000151lws.dyn.uncc.edu
rank : 3 (local_rank: 3)
exitcode : -11 (pid: 234916)
error_file: <N/A>
traceback : Signal 11 (SIGSEGV) received by PID 234916

Root Cause (first observed failure):
[0]:
time : 2022-06-13_23:04:55
host : coe54000151lws.dyn.uncc.edu
rank : 0 (local_rank: 0)
exitcode : -11 (pid: 234913)
error_file: <N/A>
traceback : Signal 11 (SIGSEGV) received by PID 234913

Can anybody help me solve this issue?
Thanks!

error in "python demo/demo_skeleton.py demo/ntu_sample.avi demo/demo.mp4"

Thanks for sharing the implementation. When running the demo, the following error message. Please advice.

(pyskl) D:\gitSources\pyskl>python demo/demo_skeleton.py demo/ntu_sample.avi demo/demo.mp4
load checkpoint from http path: https://download.openmmlab.com/mmaction/pyskl/ckpt/posec3d/slowonly_r50_ntu120_xsub/joint.pth
Traceback (most recent call last):
File "demo/demo_skeleton.py", line 309, in
main()
File "demo/demo_skeleton.py", line 250, in main
det_results = detection_inference(args, frame_paths)
File "demo/demo_skeleton.py", line 157, in detection_inference
assert model.CLASSES[0] == 'person', ('We require you to use a detector '
AttributeError: 'NoneType' object has no attribute 'CLASSES'

(pyskl) D:\gitSources\pyskl>

Computer:
Y720
Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz 2.80 GHz
16.0 GB (15.9 GB usable)
NVIDIA GeForce GTX 1060
Windows 10 Home

Installation:
conda create -n pyskl python=3.8 pytorch=1.10 cudatoolkit=11.3 torchvision -c pytorch -y
pip install -r requirements.txt
pip install -e .

How to obtain the test score of PoseConv3D on NTU60-Xsub(SlowOnly-R50/joint)

I would like to reproduce the 93.7% Mean Top-1 score of PoseConv3D, on NTU60-Xsub(SlowOnly-R50/joint), by using 8 GPUs and inheriting the same setups, but the best outcome are top1_acc 0.9338 and mean_class_accuracy 0.9337 in the 24 epoch, there is a 0.32% gap. Moreover, the best scores of your log file (https://download.openmmlab.com/mmaction/skeleton/posec3d/slowonly_r50_u48_240e_ntu60_xsub_keypoint/slowonly_r50_u48_240e_ntu60_xsub_keypoint.log) are top1_acc 0.9352 and mean_class_accuracy 0.9351 in the 23 epoch, it is also a 0.18% gap compared to 93.7%.

The reason may be that my test method is wrong, are there any settings that need to be adjusted?

Accuracy of CTRGCN cannot be reproduced

I try to train CTRGCN with 2d skeleton and joint modality, but the accuracy dropped over 1%. I didn't change anything, except training with only 4 gpus. Would a few less gpus have such a big impact on accuracy? It's quite strange. So I wonder if you have tuned any hyperparameters during training. Thanks in advance.

Can't run /tools/data/custom_2d_skeleton.py from my data?

When I run /tools/data/custom_2d_skeleton.py,there has a problem
File "tools/data/custom_2d_skeleton.py", line 176, in
main()
File "tools/data/custom_2d_skeleton.py", line 123, in main
init_dist('pytorch', backend='nccl')
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmcv/runner/dist_utils.py", line 18, in init_dist
_init_dist_pytorch(backend, **kwargs)
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/mmcv/runner/dist_utils.py", line 29, in _init_dist_pytorch
rank = int(os.environ['RANK'])
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/os.py", line 675, in getitem
raise KeyError(key) from None
KeyError: 'RANK'

I can't find RANK from "os.environ['RANK']",so I change 'LOCAL_RANK' to 'RANK',but there has other problem,about that:
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 224, in _env_rendezvous_handler
world_size = int(_get_env_or_raise("WORLD_SIZE"))
File "/home/xunlong/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 203, in _get_env_or_raise
raise _env_error(env_var)
ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable WORLD_SIZE expected, but not set

who solved this question,please give some advises,Thank you very much!

How to implement posec3D on my own computer

Hello, I would like to ask you how to achieve PoseC3D in your own computer?
Is there anything else to be configured after the requirement is configured?
Which file do I need to run?

demo_stgcn++

i followed your suggestion,
@kennymckormick
Collaborator
kennymckormick commented 14 days ago
Hi, jeongeun12,
Currently PoseC3D does not support training with 3d joints directly. To use PoseC3D, you need to first project 3d keypoints to 2d keypoints (for example, find a project view that reserve the majority of inter-keypoint variance).
If you want to directly use 3d joints for training, I recommend you to move to PYSKL, where we released an original SOTA gcn model named ST-GCN++

i finally trained st_gcn++ with 3d kp datasets,and i want to demo it.
is it ok that i use inference_recognizer model in demo_posec3d code ??

error: unrecognized arguments: --ckpt

when I run command: python demo/demo_skeleton.py demo/ntu_sample.avi demo/demo.mp4 --config configs/stgcn++/stgcn++_ntu120_xsub_hrnet/j.py --ckpt http://download.openmmlab.com/mmaction/pyskl/ckpt/stgcnpp/stgcnpp_ntu120_xsub_hrnet/j.pth
I get an error:
usage: demo_skeleton.py [-h] [--config CONFIG] [--checkpoint CHECKPOINT] [--det-config DET_CONFIG] [--det-checkpoint DET_CHECKPOINT]
[--pose-config POSE_CONFIG] [--pose-checkpoint POSE_CHECKPOINT] [--det-score-thr DET_SCORE_THR] [--label-map LABEL_MAP]
[--device DEVICE] [--short-side SHORT_SIDE]
video out_filename
demo_skeleton.py: error: unrecognized arguments: --ckpt http://download.openmmlab.com/mmaction/pyskl/ckpt/stgcnpp/stgcnpp_ntu120_xsub_hrnet/j.pth

Custom dataset

in which guide should I follow to train my custom dataset with posec3d? Should I follow the one in mmaction2 or is there a different one for pyskl? Thanks.

error when training on diving48

`2022-07-12` 09:06:11,803 - pyskl - INFO - workflow: [('train', 1)], max: 24 epochs
2022-07-12 09:06:11,804 - pyskl - INFO - Checkpoints will be saved to /content/pyskl/work_dirs/posec3d/slowonly_r50_diving48/joint by HardDiskBackend.
tcmalloc: large alloc 1421410304 bytes == 0x16513c000 @  0x7f96e32b4615 0x592b76 0x4df71e 0x59394f 0x5957cf 0x595b69 0x4e7b1f 0x4ebeeb 0x44f8bc 0x4e9074 0x4ebe42 0x4ec608 0x4eb932 0x4ec55d 0x4e9074 0x4ebe42 0x4ec55d 0x4e9074 0x4ebe42 0x44f841 0x4ec608 0x4e9074 0x4ebe42 0x55e1fa 0x59afff 0x515655 0x549576 0x593fce 0x548ae9 0x51566f 0x593dd7
tcmalloc: large alloc 1421410304 bytes == 0x7f94e97fe000 @  0x7f96e32b4615 0x592b76 0x4df71e 0x59394f 0x5957cf 0x595b69 0x4e7b1f 0x4ebeeb 0x44f8bc 0x4e9074 0x4ebe42 0x4ec608 0x4eb932 0x4ec55d 0x4e9074 0x4ebe42 0x4ec55d 0x4e9074 0x4ebe42 0x44f841 0x4ec608 0x4e9074 0x4ebe42 0x55e1fa 0x59afff 0x515655 0x549576 0x593fce 0x548ae9 0x51566f 0x593dd7
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: -9) local_rank: 0 (pid: 634) of binary: /usr/bin/python3
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/dist-packages/torch/distributed/launch.py", line 193, in <module>
    main()
  File "/usr/local/lib/python3.7/dist-packages/torch/distributed/launch.py", line 189, in main
    launch(args)
  File "/usr/local/lib/python3.7/dist-packages/torch/distributed/launch.py", line 174, in launch
    run(args)
  File "/usr/local/lib/python3.7/dist-packages/torch/distributed/run.py", line 718, in run
    )(*cmd_args)
  File "/usr/local/lib/python3.7/dist-packages/torch/distributed/launcher/api.py", line 131, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/usr/local/lib/python3.7/dist-packages/torch/distributed/launcher/api.py", line 247, in launch_agent
    failures=result.failures,
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
====================================================
tools/train.py FAILED

an error about extracting diving48_annos.pkl

Dear kenny,
First of all, thank you for your excellent work!Recently, I am trying to run your code of pyskl. However, I have met a problem about examples/extract_diving48_skeleton.

I would like to get diving48_annos.pkl through following your notebook diving48_example.ipynb. But when I run the code, there is a error:

raise subprocess.CalledProcessError(returncode=process.returncode,
subprocess.CalledProcessError: Command '['/anaconda3/envs/cdpytorch/bin/python', '-u', 'tools/data/custom_2d_skeleton.py', '--local_rank=1', '--video-list', 'examples/extract_diving48_skeleton/diving48.list', '--out', 'examples/extract_diving48_skeleton/diving48_annos.pkl']' died with <Signals.SIGSEGV: 11>.

I have checked the github issue and searched on the Internet. Unfortunately, I haven't found relevant solutions. So I sent you an email, hoping to get your help!Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.