GithubHelp home page GithubHelp logo

yangzeyu95 / unofficial-implement-of-openpose Goto Github PK

View Code? Open in Web Editor NEW
271.0 5.0 80.0 17.7 MB

Implement of Openpose use Tensorflow

Python 74.01% C 25.53% C++ 0.33% SWIG 0.13%
tensorflow openpose pose-estimation vgg deep-learning deep-neural-networks

unofficial-implement-of-openpose's Introduction

Unofficial-Implement-of-Openpose

  

You can check the full result on YouTube or bilibili  

An easy implement of openpose using TensorFlow.

Only basic python is used, so the code is easy to understand.

You can check the graph, internal outputs of every stage and histogram of every layer in tensorboard.

Original Repo(Caffe) : https://github.com/CMU-Perceptual-Computing-Lab/openpose.

The Dataloader and Post-processing code is from tf-pose-estimation.

Python 3.6  

 

Training

  1. Download vgg19 weights file here or 链接: https://pan.baidu.com/s/1t6iouKeDZBZRRg4BXsv5GA 提取码: 4k1w and uzip to 'checkpoints/vgg/' (please create the path yourself).

  2. Download COCO2017: 2017 Train images, 2017 Val images and 2017 Train/Val annotations here.
    make sure have this structure:
    -COCO/
     -images/
      -train2017/
      -val2017/
     -annotations/

  3. Specify '--annot_path_train' and '--img_path_train' in train.py to your own 'COCO/annotations/' and 'COCO/images/'.

  4. run train.py python train.py and install requirements follow the error and run again.

    

Test

Specify --checkpoint_path to the folder includes checkpoint files in run.py.  

  • running on webcam python run.py  
  • running on video python run.py --video images/video.avi  
  • running on imagepython run.py --image images/ski.jpg  

pretrained model on COCO 2017 is available here or 链接: https://pan.baidu.com/s/1jcwRsOuEaveZRBU50lP_cQ 提取码: mqkr, this checkpoint includes fine-tuned vgg weights.  

unofficial-implement-of-openpose's People

Contributors

kurzacz avatar yangzeyu95 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

unofficial-implement-of-openpose's Issues

导入已训练模型后test出错

你好,我导入了你提供的模型,然后在做test的时候发现
File "run.py", line 160, in
peaks, heatmap, vectormap = sess.run([tensor_peaks, hm_up, cpm_up], feed_dict={raw_img: img, img_size: size})
File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
run_metadata_ptr)
File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\client\session.py", line 1095, in _run
'Cannot interpret feed_dict key as Tensor: ' + e.args[0])
TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("inputs/Placeholder:0", shape=(?, ?, ?, 3), dtype=float32) is not an element of this graph.

在读图时似乎图的尺寸没有读到,视频也有类似问题

VGG

博主你好 @你提供下载的checkpoint没看到有VGG19的啊

数据集

请问annotations是下载以下列出的哪个版本呢?
2017 Stuff Train/Val annotations [1.1GB]
2017 Panoptic Train/Val annotations [821MB]

Checkpoint file to .pb file conversion

Can I have the .pb file of the checkpoint file?
I tried the code from the answer at Stackoverflow

import tensorflow as tf

meta_path = 'model-59000.ckpt.meta' # Your .meta file

with tf.Session() as sess:

    # Restore the graph
    saver = tf.train.import_meta_graph(meta_path)

    # Load weights
    saver.restore(sess,tf.train.latest_checkpoint('.'))

    # Output nodes
    output_node_names =[n.name for n in tf.get_default_graph().as_graph_def().node]

    # Freeze the graph
    frozen_graph_def = tf.graph_util.convert_variables_to_constants(
        sess,
        sess.graph_def,
        output_node_names)

    # Save the frozen graph
    with open('output_graph.pb', 'wb') as f:
      f.write(frozen_graph_def.SerializeToString())

But that produced the following errors

(tensorflow) H:\OpenPose\unofficial-implement-of-openpose\checkpoints\train\2018-12-13-16-56-49>python toPb.py
C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2018-12-31 17:05:27.908516: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
Traceback (most recent call last):
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _do_call
    return fn(*args)
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1329, in _run_fn
    status, run_metadata)
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value global_step
         [[Node: _retval_global_step_0_0 = _Retval[T=DT_INT32, index=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](global_step)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "toPb.py", line 20, in <module>
    output_node_names)
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\framework\graph_util_impl.py", line 243, in convert_variables_to_constants
    returned_variables = sess.run(variable_names)
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 895, in run
    run_metadata_ptr)
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1128, in _run
    feed_dict_tensor, options, run_metadata)
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1344, in _do_run
    options, run_metadata)
  File "C:\Program Files\Anaconda2\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1363, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value global_step
         [[Node: _retval_global_step_0_0 = _Retval[T=DT_INT32, index=0, _device="/job:localhost/replica:0/task:0/device:CPU:0"](global_step)]]

Why reset_state and get_data are not attributes of self.ds in posedataset.py?

Hi, There was an error called OutOfRangeError during training. the error message is as follows [2019-07-15 05:18:54,340] [pose_dataset] [ERROR] err type2, err=Cannot feed value of shape (5, 46, 46, 11) for Tensor 'inputs/Placeholder:0', which has shape '(5, 368, 368, 3)', placeholders=[<tf.Tensor 'inputs/Placeholder:0' shape=(5, 368, 368, 3) dtype=float32>, <tf.Tensor 'inputs/Placeholder_1:0' shape=(5, 46, 46, 11) dtype=float32>, <tf.Tensor 'inputs/Placeholder_2:0' shape=(5, 46, 46, 22) dtype=float32>]

I checked the attributes of self.ds in Line 438 in posedataset.py but I received these dict_keys(['ds', '_size', 'nr_proc', 'nr_prefetch', 'queue', 'procs'])

why reset_state and get_data aren't in it??

I need to train on my own dataset. Can someone help me?? thank you

DataLossError stored 2112521139 vs. calculated on the restored bytes 4004437628

DataLossError (see above for traceback): Checksum does not match: stored 2112521139 vs. calculated on the restored bytes 4004437628
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

非常感谢您的分享,按照github思路,想跑通您的网络,最后报错是这个问题,请问是哪里不对,谢谢。

请问下,训练时出现OutOfRangeError是什么情况呢?

训练的时候出了个叫OutOfRangeError的错误,报错信息如下2019-01-29 15:02:54,044] [pose_dataset] [ERROR] err type2, err=Cannot feed value of shape (10, 184, 184, 19) for Tensor 'inputs/Placeholder_1:0', which has shape '(10, 46, 46, 19)', placeholders=[<tf.Tensor 'inputs/Placeholder:0' shape=(10, 368, 368, 3) dtype=float32>, <tf.Tensor 'inputs/Placeholder_1:0' shape=(10, 46, 46, 19) dtype=float32>, <tf.Tensor 'inputs/Placeholder_2:0' shape=(10, 46, 46, 38) dtype=float32>]
[2019-01-29 15:02:54,045] [pose_dataset] [ERROR] Exception in Thread-1:Cannot feed value of shape (10, 184, 184, 19) for Tensor 'inputs/Placeholder_1:0', which has shape '(10, 46, 46, 19)'
Traceback (most recent call last):
File "F:\pose\unofficial-implement-of-openpose-master\pose_dataset.py", line 442, in run
self.op.run(feed_dict=feed)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2241, in run
_run_using_default_session(self, feed_dict, self.graph, session)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 4986, in _run_using_default_session
session.run(operation, feed_dict)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 877, in run
run_metadata_ptr)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1076, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (10, 184, 184, 19) for Tensor 'inputs/Placeholder_1:0', which has shape '(10, 46, 46, 19)'
[2019-01-29 15:02:55,525] [pose_dataset] [INFO] Thread-1 Exited.

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1278, in _do_call
return fn(*args)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1263, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: fifo_queue_Dequeue = QueueDequeueV2component_types=[DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 198, in
train()
File "train.py", line 164, in train
total_loss, _, gs_num = sess.run([loss, train, global_step])
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 877, in run
run_metadata_ptr)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1100, in _run
feed_dict_tensor, options, run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1272, in _do_run
run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1291, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: fifo_queue_Dequeue = QueueDequeueV2component_types=[DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Caused by op 'fifo_queue_Dequeue', defined at:
File "train.py", line 198, in
train()
File "train.py", line 82, in train
q_inp, q_heat, q_vect = enqueuer.dequeue()
File "F:\pose\unofficial-implement-of-openpose-master\pose_dataset.py", line 464, in dequeue
return self.queue.dequeue()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\data_flow_ops.py", line 433, in dequeue
self._queue_ref, self._dtypes, name=name)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_data_flow_ops.py", line 4096, in queue_dequeue_v2
timeout_ms=timeout_ms, name=name)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 454, in new_func
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3155, in create_op
op_def=op_def)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1717, in init
self._traceback = tf_stack.extract_stack()

OutOfRangeError (see above for traceback): FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: fifo_queue_Dequeue = QueueDequeueV2component_types=[DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

train

Instructions for updating:
Use standard file APIs to check for files with this prefix.
[2019-04-13 18:25:02,982] [train] [INFO] restoring from checkpoint...
[2019-04-13 18:25:02,982] [train] [INFO] start training...
0%| | 0/1848 [00:00<?, ?it/s]

why the process stop 0% for a long time,is it wrong?or it maybe just running?Can you help me please?

Pre-trained model

Thank you for your excellent work.
I would like to know if it is possible to test images / videos without having to re-train the model. I mean, is there a pre-trained model?
Because I do not have the equipment required to do a training and it may take me several days to have a satisfactory result.
Cheers.

Problem with run.py

Hi

I am trying to use run.py with webcam on a cpu-only machine

I downloaded the vgg19 and pretrained models and made checkpoints directory as bellow:

Screenshot from 2019-07-12 17-59-29

and changed the code like this:

Screenshot from 2019-07-12 17-33-34

however when I execute run.py , I get the following error:

2019-07-12 17:56:33,712] [run] [INFO] checkpoint_path: checkpoints/pretrained
WARNING: Logging before flag parsing goes to stderr.
I0712 17:56:33.712154 140183425660736 run.py:37] checkpoint_path: checkpoints/pretrained
W0712 17:56:33.713050 140183425660736 deprecation_wrapper.py:119] From run.py:40: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0712 17:56:33.721329 140183425660736 deprecation_wrapper.py:119] From /home/bardia/Documents/University/Bachelor Project/unofficial-implement-of-openpose/vgg.py:244: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

[2019-07-12 17:56:34,558] [run] [INFO] initializing model...
I0712 17:56:34.558601 140183425660736 run.py:50] initializing model...
W0712 17:56:34.564836 140183425660736 deprecation_wrapper.py:119] From /home/bardia/Documents/University/Bachelor Project/unofficial-implement-of-openpose/cpm.py:141: The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead.

W0712 17:56:34.589925 140183425660736 deprecation_wrapper.py:119] From /home/bardia/Documents/University/Bachelor Project/unofficial-implement-of-openpose/cpm.py:153: The name tf.summary.histogram is deprecated. Please use tf.compat.v1.summary.histogram instead.

W0712 17:56:37.113407 140183425660736 deprecation_wrapper.py:119] From run.py:54: The name tf.image.resize_area is deprecated. Please use tf.compat.v1.image.resize_area instead.

W0712 17:56:37.135530 140183425660736 deprecation.py:323] From run.py:63: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
[2019-07-12 17:56:37,136] [run] [INFO] initialize saver...
I0712 17:56:37.136752 140183425660736 run.py:65] initialize saver...
W0712 17:56:37.136974 140183425660736 deprecation_wrapper.py:119] From run.py:68: The name tf.get_collection is deprecated. Please use tf.compat.v1.get_collection instead.

W0712 17:56:37.137136 140183425660736 deprecation_wrapper.py:119] From run.py:68: The name tf.GraphKeys is deprecated. Please use tf.compat.v1.GraphKeys instead.

W0712 17:56:37.138484 140183425660736 deprecation_wrapper.py:119] From run.py:72: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

[2019-07-12 17:56:37,370] [run] [INFO] initialize session...
I0712 17:56:37.370700 140183425660736 run.py:74] initialize session...
2019-07-12 17:56:37.374638: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-07-12 17:56:37.417958: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2494190000 Hz
2019-07-12 17:56:37.418350: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x66919a0 executing computations on platform Host. Devices:
2019-07-12 17:56:37.418400: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
2019-07-12 17:56:38.243818: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
2019-07-12 17:56:38.360024: W tensorflow/core/framework/allocator.cc:107] Allocation of 67108864 exceeds 10% of system memory.
2019-07-12 17:56:38.561824: W tensorflow/core/framework/allocator.cc:107] Allocation of 411041792 exceeds 10% of system memory.
[2019-07-12 17:56:41,446] [run] [INFO] restoring vgg weights...
I0712 17:56:41.446801 140183425660736 run.py:79] restoring vgg weights...
W0712 17:56:41.479456 140183425660736 deprecation.py:323] From /home/bardia/env_dir/main_venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py:1276: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
[1]    7928 killed     python run.py

should I change any part of the code, since I have a cpu-only machine like line 76 in run.py?
could you help me where I am doing wrong?

The error of estimator.py

Hi,
When I run the estimator.py ,I will get the error as follow :File Not Found Error: [Errno 2] No such file or directory: './etcs/heatpaf1.pkl',How can I get the file of 'heatpaf1.pkl' ?Can you please help?

openpose with depth images

Hi, I want to train openpose on my own dataset. but images are depth and I don't know how to use pre-train vgg19 with this input.
also, I repeat the image array 3 times on a new dimension. but I don't get a good result.
How can I solve this problem?
Can someone help me? Thanks

heatmap score

Hi, Thanks for sharing the awesome code for openpose. I have a question about heatmaps in run.py code.
How can I calculate the score of prediction heatmap for every test image? because I need score in evaluation code.
Thank you.

训练代码好像不能使用GPU?

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.40 Driver Version: 430.40 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 106... Off | 00000000:01:00.0 On | N/A |
| 0% 50C P8 6W / 120W | 366MiB / 6077MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

what is the error of "msb006"

I built this program in vs 2017,and cuda 9.2 it match cudnn ,but the project running the vs 2017 has a error about "msb 006",I do not how to deal with this problem .and now I set up the environment in linux and try to build this throungt linux

About the loss of training

Exceuse me, I have trained the model according to your steps, i find that the model only trained 5 epochs and the final loss is around 215 ~ 230, and i have test the ski image, the performance is not much accurate but not too bad. Can i improve the model performance by training more epochs and what about the learning rate set? Could you give me some advice, thank you so much.

博主 window环境下train 出现下面问题,怎么办呀?

(tensorflow-gpuversion) C:\Projects\unofficial-implement-of-openpose>python train_v2.py
[2019-07-04 00:12:14,387] [train] [INFO] Namespace(annot_path='COCO/annotations/', backbone_net_ckpt_path='checkpoints/vgg/vgg_19.ckpt', batch_size=10, checkpoint_path='checkpoints/train/', continue_training=False, hm_channels=19, img_path='COCO/images/', input_height=368, input_width=368, loss_func='l2', max_echos=5, paf_channels=38, save_checkpoint_frequency=1000, save_summary_frequency=100, stage_num=6, train_vgg=True, use_bn=False)
[2019-07-04 00:12:14,388] [train] [INFO] checkpoint_path: checkpoints/train/2019-7-4-0-12-14
[2019-07-04 00:12:14,391] [train] [INFO] initializing data loader...
[2019-07-04 00:12:14,391] [pose_dataset] [INFO] dataflow img_path=COCO/images/
loading annotations into memory...
Done (t=9.51s)
creating index...
index created!
[2019-07-04 00:12:24,121] [pose_dataset] [INFO] COCO/annotations/ dataset 118287
[0704 00:12:24 @parallel.py:184] WRN MultiProcessPrefetchData does support Windows. However, Windows requires more strict picklability on processes, which may lead of failure on some of the code.
[0704 00:12:24 @parallel.py:194] [MultiProcessPrefetchData] Will fork a dataflow more than one times. This assumes the datapoints are i.i.d.
Failed to load OpenCL runtime
Failed to load OpenCL runtime
Failed to load OpenCL runtime
Traceback (most recent call last):
File "", line 1, in
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
MemoryError
Traceback (most recent call last):
File "train_v2.py", line 198, in
train()
File "train_v2.py", line 80, in train
df = get_dataflow_batch(args.annot_path, True, args.batch_size, img_path=args.img_path)
File "C:\Projects\unofficial-implement-of-openpose\pose_dataset.py", line 389, in get_dataflow_batch
ds = get_dataflow(path, is_train, img_path=img_path)
File "C:\Projects\unofficial-implement-of-openpose\pose_dataset.py", line 368, in get_dataflow
ds = PrefetchData(ds, 1000, multiprocessing.cpu_count()-1)
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\site-packages\tensorpack\dataflow\parallel.py", line 201, in init
start_proc_mask_signal(self.procs)
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\site-packages\tensorpack\utils\concurrency.py", line 244, in start_proc_mask_signal
p.start()
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "C:\software\Anaconda3\envs\tensorflow-gpuversion\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
BrokenPipeError: [Errno 32] Broken pipe

运行错误

when i use the pretrained model to test the video,it has occur
error: OpenCV(3.4.2) C:\Miniconda3\conda-bld\opencv-suite_1534379934306\work\modules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'
how to resolve this problem

Question about pose_dataset.py

I want to use this code in my project. My task is to detect the seven visible vertices of the cube. When I prepared the data set according to the COCO format, I found that the function in pose_dataset.py reported an error. After testing, I found that COCO keypoints dataset has 17 keypoints. but cube only have 7, so I want to know how to modify the pose_dataset.py so that I can solve it. Thanks a lot!

模型转换

您好, 我想把您的模型转换成移动设备支持的格式tflite
但是在转换pb的过程中需要一个output_node_names参数,这个参数应该填什么呢?

problem with run

您好,感谢您做的工作,我现在跑run.py的过程中,在跑图片和视频的时候分别报了如下错误:不太懂这个函数是干什么的,所以不太好调试,麻烦帮忙看看,谢谢。
图片报错:

Traceback (most recent call last):
  File "E:/python_project/unofficial-implement-of-openpose-master/run.py", line 137, in <module>
    bodys = PoseEstimator.estimate_paf(peaks[0], heatmap[0], vectormap[0])
  File "E:\python_project\unofficial-implement-of-openpose-master\estimator.py", line 276, in estimate_paf
    pafprocess.process_paf(peaks, heat_mat, paf_mat)
NameError: name 'pafprocess' is not defined

视频报错:

Traceback (most recent call last):
  File "E:/python_project/unofficial-implement-of-openpose-master/run.py", line 114, in <module>
    bodys = PoseEstimator.estimate_paf(peaks[0], heatmap[0], vectormap[0])
  File "E:\python_project\unofficial-implement-of-openpose-master\estimator.py", line 276, in estimate_paf
    pafprocess.process_paf(peaks, heat_mat, paf_mat)
NameError: name 'pafprocess' is not defined
OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'

my own dataset

Hi, when I train openpose on my own dataset(small dataset), how to know it works well for my dataset in data augmentation part of get_data() in pose_dataset.py (lines 355-359 )?
is it possible that new coordinates of key points don't adjust well on the augmented image? or it works correctly for any dataset?
because after running run.py with my pre_trained model, the output image of heatmap and vector map are not acceptable.is it ok because of my small dataset or I should check the augmentation part?
Can someone help me, Thank you.

ds = MapDataComponent(ds, pose_random_scale)
ds = MapDataComponent(ds, pose_rotation)
ds = MapDataComponent(ds, pose_flip)
ds = MapDataComponent(ds, pose_resize_shortestedge_random)
ds = MapDataComponent(ds, pose_crop_random)

找不到slidingwindow.py

zeyu你好,
我在执行run.py的时候报错如下:
File "C:\Users\Yuan\Downloads\unofficial-implement-of-openpose-master\estimator.py", line 4, in
import slidingwindow as sw
ModuleNotFoundError: No module named 'slidingwindow'

找不到slidingwindow.py。请帮忙看一下,谢谢!

How to improve performance?

First, thank you for sharing. I tested your pre-trained model on my Linux(GTX 1080), but my fps was about 5. Do you have some ideas to may it real-time? Really appreciate.

加载VGG19时出了问题

[2019-05-08 13:14:21,856] [run] [INFO] initializing model...
[2019-05-08 13:14:24,252] [run] [INFO] initialize saver...
[2019-05-08 13:14:24,487] [run] [INFO] initialize session...
[2019-05-08 13:14:26,269] [run] [INFO] restoring vgg weights...
WARNING:tensorflow:From C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
Traceback (most recent call last):

File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3313, in run_code
self.showtraceback(running_compiled_code=True)

File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2038, in showtraceback
self._showtraceback(etype, value, stb)

File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\ipykernel\zmqshell.py", line 557, in _showtraceback
dh.parent_header, ident=topic)

File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\session.py", line 737, in send
to_send = self.serialize(msg, ident)

File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\session.py", line 625, in serialize
content = self.pack(content)

File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\session.py", line 103, in
ensure_ascii=False, allow_nan=False,

File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\zmq\utils\jsonapi.py", line 43, in dumps
s = s.encode('utf8')

UnicodeEncodeError: 'utf-8' codec can't encode character '\udc83' in position 3017: surrogates not allowed

19parts?

Thanks for your work ,I have a question here.COCO has 17 keypoints why coco_parts = 19?

model-55000.ckpt

Bro,can you share the model-55000.ckpt file? Our own GPU capability is not enough. It takes about three weeks to get results. I look forward to your reply, thank you.

Performane and eval code?

Thanks for sharing you code. Do you have any eval code to show your performance is the same as the original version?

Evaluate the performance of a model

Hello, Thanks for sharing the awesome code .how to evaluate the performance of a model on my own dataset? there is only the loss, not accuracy
also how to calculate AP for a test image?
Thanks.

learning rate

Hi,
I use my own dataset in train.py and step size is 350. in during training , learning rate is decreasing and in middle of steps it's value is 0.0 and loss doesn't change. I try another init value for learning rate also test momentum. but i get an error in line 168,
total_loss, gs_num, summary, lr = sess.run([loss, global_step, merged, learning_rate])
how can i solve this problem?
thanks

使用coco数据集训练出错

(base) C:\Users\ric\Desktop\PBL\ri\unofficial-implement-of-openpose-master\program>python train.py
[2019-05-31 09:54:12,264] [train] [INFO] Namespace(annot_path='C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/COCO/annotations/', backbone_net_ckpt_path='C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/checkpoints/vgg/vgg_19.ckpt', batch_size=10, checkpoint_path='C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/checkpoint/train', continue_training=False, hm_channels=19, img_path='C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/COCO/images/', input_height=368, input_width=368, loss_func='l2', max_echos=5, paf_channels=38, save_checkpoint_frequency=1000, save_summary_frequency=100, stage_num=6, train_vgg=True, use_bn=False)
[2019-05-31 09:54:12,265] [train] [INFO] checkpoint_path: C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/checkpoint/train2019-5-31-9-54-12
[2019-05-31 09:54:12,270] [train] [INFO] initializing data loader...
C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/COCO/annotations/
[2019-05-31 09:54:12,270] [pose_dataset] [INFO] dataflow img_path=C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/COCO/images/
loading annotations into memory...
Done (t=8.39s)
creating index...
index created!
[2019-05-31 09:54:20,857] [pose_dataset] [INFO] C:/Users/ric/Desktop/PBL/ri/unofficial-implement-of-openpose-master/COCO/annotations/ dataset 118287
[0531 09:54:20 @parallel.py:184] WRN MultiProcessPrefetchData does support Windows. However, Windows requires more strict picklability on processes, which may lead of failure on some of the code.
[0531 09:54:20 @parallel.py:194] [MultiProcessPrefetchData] Will fork a dataflow more than one times. This assumes the datapoints are i.i.d.
[0531 09:56:27 @parallel.py:184] WRN MultiProcessPrefetchData does support Windows. However, Windows requires more strict picklability on processes, which may lead of failure on some of the code.
[0531 09:56:27 @parallel.py:194] [MultiProcessPrefetchData] Will fork a dataflow more than one times. This assumes the datapoints are i.i.d.
Traceback (most recent call last):
File "train.py", line 198, in
train()
File "train.py", line 79, in train
df = get_dataflow_batch(args.annot_path, True, args.batch_size, img_path=args.img_path)
File "C:\Users\ric\Desktop\PBL\ri\unofficial-implement-of-openpose-master\program\pose_dataset.py", line 390, in get_dataflow_batch
ds = PrefetchData(ds, 10, 2)
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorpack\dataflow\parallel.py", line 201, in init
start_proc_mask_signal(self.procs)
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorpack\utils\concurrency.py", line 244, in start_proc_mask_signal
p.start()
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle weakref objects

(base) C:\Users\ric\Desktop\PBL\ri\unofficial-implement-of-openpose-master\program>Traceback (most recent call last):
File "", line 1, in
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\Users\ric\AppData\Local\Continuum\anaconda3\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

一运行train.py过一会电脑就会重启。。

emmmm电脑配置是i7-4790+1080Ti,系统、代码、数据集都在一块SSD里。
下载了你的ckpt来进行测试时没问题的,但是一运行train.py过一会电脑就会重启。。求解答。。我下载了VGG的权重按要求放好了数据集,别的什么也没改。

不知道是什么原因呃?

使用COCO数据集训练时MEMORYERROR

(base) D:\job\openposetf\unofficial-implement-of-openpose-master>python train.py
[2019-05-30 22:16:52,016] [train] [INFO] Namespace(annot_path='D:/job/openposetf/checkpoints/COCO/annotations/', backbone_net_ckpt_path='D:/job/openposetf/checkpoints/vgg/vgg_19.ckpt', batch_size=10, checkpoint_path='D:/job/openposetf/checkpoints/train/', continue_training=False, hm_channels=19, img_path='D:/job/openposetf/checkpoints/COCO/images/', input_height=368, input_width=368, loss_func='l2', max_echos=5, paf_channels=38, save_checkpoint_frequency=1000, save_summary_frequency=100, stage_num=6, train_vgg=True, use_bn=False)
[2019-05-30 22:16:52,018] [train] [INFO] checkpoint_path: D:/job/openposetf/checkpoints/train/2019-5-30-22-16-52
[2019-05-30 22:16:52,021] [train] [INFO] initializing data loader...
[2019-05-30 22:16:52,022] [pose_dataset] [INFO] dataflow img_path=D:/job/openposetf/checkpoints/COCO/images/
loading annotations into memory...
Done (t=10.02s)
creating index...
index created!
[2019-05-30 22:17:02,246] [pose_dataset] [INFO] D:/job/openposetf/checkpoints/COCO/annotations/ dataset 118287
[0530 22:17:02 @parallel.py:184] WRN MultiProcessPrefetchData does support Windows. However, Windows requires more strict picklability on processes, which may lead of failure on some of the code.
[0530 22:17:02 @parallel.py:194] [MultiProcessPrefetchData] Will fork a dataflow more than one times. This assumes the datapoints are i.i.d.
Traceback (most recent call last):
File "train.py", line 196, in
train()
File "train.py", line 78, in train
df = get_dataflow_batch(args.annot_path, True, args.batch_size, img_path=args.img_path)
File "D:\job\openposetf\unofficial-implement-of-openpose-master\pose_dataset.py", line 388, in get_dataflow_batch
ds = get_dataflow(path, is_train, img_path=img_path)
File "D:\job\openposetf\unofficial-implement-of-openpose-master\pose_dataset.py", line 367, in get_dataflow
ds = PrefetchData(ds, 1000, multiprocessing.cpu_count()-1)
File "D:\anaconda\lib\site-packages\tensorpack\dataflow\parallel.py", line 201, in init
start_proc_mask_signal(self.procs)
File "D:\anaconda\lib\site-packages\tensorpack\utils\concurrency.py", line 244, in start_proc_mask_signal
p.start()
File "D:\anaconda\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "D:\anaconda\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "D:\anaconda\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "D:\anaconda\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "D:\anaconda\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
MemoryError

(base) D:\job\openposetf\unofficial-implement-of-openpose-master>Traceback (most recent call last):
File "", line 1, in
File "D:\anaconda\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "D:\anaconda\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

我的电脑配置是CPU i7-8550 内存 8GB GPU NVIDIA GeForce MX150
每次运行时CPU和内存占用率都90%以上

训练时候出现以下错误

[2019-09-02 13:19:42,680] [train] [INFO] echos=0.067636, setp=800, total_loss=328.150238, lr=0.000100
8%|██▍ | 899/11828 [16:32:26<200:52:08, 66.17s/it][2019-09-02 15:10:04,099] [train] [INFO] echos=0.076091, setp=900, total_loss=158.620926, lr=0.000100
8%|██▋ | 999/11828 [18:23:09<199:12:21, 66.22s/it][2019-09-02 17:00:47,341] [train] [INFO] echos=0.084545, setp=1000, total_loss=467.270477, lr=0.000100
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
*** Received signal 6 ***
*** BEGIN MANGLED STACK TRACE ***
/usr/local/lib/python3.6/dist-packages/tensorflow/python/../libtensorflow_framework.so(+0x6ae97b)[0x7f727e64697b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f72a02dc390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f729ff36428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f729ff3802a]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x16d)[0x7f727da9d84d]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x8d6b6)[0x7f727da9b6b6]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x8d701)[0x7f727da9b701]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb8d38)[0x7f727dac6d38]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f72a02d26ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f72a000841d]
*** END MANGLED STACK TRACE ***

*** Begin stack trace ***
tensorflow::CurrentStackTrace()

gsignal
abort
__gnu_cxx::__verbose_terminate_handler()

pafprocess处理的问题

请问pafprocess这步,在运行swig -python -c++ pafprocess.i && python3 setup.py build_ext --inplace之后获得一个pafprocess.o与一个pafprocess_wrap.o,是否正确?
因为我在获得这两个文件之后还是报错,No module named '_pafprocess'

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.