3d-pose-baseline icon indicating copy to clipboard operation
3d-pose-baseline copied to clipboard

cache_on_fail error

Open DannyYCCheng opened this issue 5 years ago • 34 comments

  1. Your operating system: Ubuntu 18.04
  2. Your tensorflow version: 1.13.1
  3. Your python version: 3.6.7
  4. The stack trace of the error that you see

I am using @ArashHosseini 's version (using it with tf-pose-estimation), and I get a cache_on_fail error:

data/h36m/S11/MyPoses/3D_positions/WalkTogether.h5
/3d-pose-baseline/src/data_utils.py:462: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.
  complete_train = copy.deepcopy( np.vstack( train_set.values() ))
2019-06-18 00:26:56.096188: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-06-18 00:26:58.450485: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x2d45eb0 executing computations on platform CUDA. Devices:
2019-06-18 00:26:58.450595: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): Tesla K40m, Compute Capability 3.5
2019-06-18 00:26:58.454522: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2200025000 Hz
2019-06-18 00:26:58.461810: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x2dfb080 executing computations on platform Host. Devices:
2019-06-18 00:26:58.461875: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>
2019-06-18 00:26:58.462975: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties: 
name: Tesla K40m major: 3 minor: 5 memoryClockRate(GHz): 0.745
pciBusID: 0000:02:00.0
totalMemory: 11.17GiB freeMemory: 11.10GiB
2019-06-18 00:26:58.463045: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-06-18 00:26:58.464870: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-06-18 00:26:58.464909: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990]      0 
2019-06-18 00:26:58.464931: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0:   N 
2019-06-18 00:26:58.465852: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10798 MB memory) -> physical GPU (device: 0, name: Tesla K40m, pci bus id: 0000:02:00.0, compute capability: 3.5)
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /3d-pose-baseline/src/linear_model.py:112: batch_normalization (from tensorflow.python.layers.normalization) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.batch_normalization instead.
WARNING:tensorflow:From /3d-pose-baseline/src/linear_model.py:112: batch_normalization (from tensorflow.python.layers.normalization) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.batch_normalization instead.
WARNING:tensorflow:From /3d-pose-baseline/src/linear_model.py:114: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
WARNING:tensorflow:From /3d-pose-baseline/src/linear_model.py:114: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
train_dir experiments/All/dropout_0.5/epochs_200/lr_0.001/residual/depth_2/linear_size1024/batch_size_64/no_procrustes/maxnorm/batch_normalization/use_stacked_hourglass/predict_17
Loading model experiments/All/dropout_0.5/epochs_200/lr_0.001/residual/depth_2/linear_size1024/batch_size_64/no_procrustes/maxnorm/batch_normalization/use_stacked_hourglass/predict_17/checkpoint-4874200
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-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.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-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.
INFO:tensorflow:Restoring parameters from experiments/All/dropout_0.5/epochs_200/lr_0.001/residual/depth_2/linear_size1024/batch_size_64/no_procrustes/maxnorm/batch_normalization/use_stacked_hourglass/predict_17/checkpoint-4874200
INFO:tensorflow:Restoring parameters from experiments/All/dropout_0.5/epochs_200/lr_0.001/residual/depth_2/linear_size1024/batch_size_64/no_procrustes/maxnorm/batch_normalization/use_stacked_hourglass/predict_17/checkpoint-4874200
INFO:__main__:calc frame 0/187
2019-06-18 00:27:01.293396: I tensorflow/stream_executor/dso_loader.cc:152] successfully opened CUDA library libcublas.so.10.0 locally
Traceback (most recent call last):
  File "src/tf-pose-estimation_3dpose_sandbox.py", line 444, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "src/tf-pose-estimation_3dpose_sandbox.py", line 388, in main
    if FLAGS.cache_on_fail:
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/flags.py", line 85, in __getattr__
    return wrapped.__getattr__(name)
  File "/usr/local/lib/python3.6/dist-packages/absl/flags/_flagvalues.py", line 473, in __getattr__
    raise AttributeError(name)
AttributeError: cache_on_fail

The code are downloaded directly from ArashHosseini's github, the only change I have made is in line 56 of openpose_3dpose_sandbox.py: _data = data["people"][0]["pose_keypoints"] to _data = data["people"][0]["pose_keypoints_2d"]

Based on the output of both OpenPose and tf-pose-estimation.

I can include the original images/json outputs/rendered outputs from OpenPose if required.

Command used: python3 src/tf-pose-estimation_3dpose_sandbox.py --camera_frame --residual --batch_norm --dropout 0.5 --max_norm --evaluateActionWise --use_sh --epochs 200 --load 4874200 --pose_estimation_json /data/3d-pose-baseline/MM_json/ --write_gif --gif_fps 30

DannyYCCheng avatar Jun 17 '19 23:06 DannyYCCheng

请问你这个问题解决了么。是怎么解决的

Montage-LSM avatar Jul 04 '19 14:07 Montage-LSM

I am having this issue too, commenting for updates.

adampelah avatar Jul 04 '19 19:07 adampelah

hi @adampelah, @DannyYCCheng, the flag was missing, commit

ArashHosseini avatar Jul 04 '19 19:07 ArashHosseini

Hi Arash, thanks for the speedy response.

I am getting this error now, any suggestions?

File "src/openpose_3dpose_sandbox.py", line 393, in main to_export = poses3d.tolist()[0] AttributeError: 'NoneType' object has no attribute 'tolist'

adampelah avatar Jul 04 '19 19:07 adampelah

@adampelah, it probably comes from the fact that no skeleton was recognized in the frame, "poses3d" is None. can you send me your frames.json's please?

ArashHosseini avatar Jul 04 '19 19:07 ArashHosseini

Yes, here is one of my keypoint files, I'm using tf-pose-estimation webcam data:

000000000008_keypoints.txt

adampelah avatar Jul 04 '19 19:07 adampelah

can you send me also the corrupt frame, it must be on the beginning. or send me all as zip. thx

ArashHosseini avatar Jul 04 '19 19:07 ArashHosseini

Here are all my keypoint jsons, thank you for the ongoing help:

tmp.zip

adampelah avatar Jul 04 '19 19:07 adampelah

46 kb...., check the zip please, is corrupt. thx

ArashHosseini avatar Jul 04 '19 19:07 ArashHosseini

I have zipped it again:

tmp (2).zip

adampelah avatar Jul 04 '19 19:07 adampelah

@adampelah where are the jsons coming from? thc

ArashHosseini avatar Jul 04 '19 20:07 ArashHosseini

jsons are coming from running: python run_webcam.py --model=mobilenet_thin --resize=432x368 --camera=0 --output_json tmp/
and then moving around in the webcam for a while

adampelah avatar Jul 04 '19 20:07 adampelah

@adampelah , normally you do a so-called "t-pose" at the beginning of a mocap seq, it has the side effect that all opticals and thus joints are recognized. Since your feet are already missing in the first frame, this causes a concatenation for the following frames... the scores are very low from the beginning. pull please and let it me know if its working for you... command, don't cache: python3.5 src/openpose_3dpose_sandbox.py --camera_frame --residual --batch_norm --dropout 0.5 --max_norm --evaluateActionWise --use_sh --epochs 200 --load 4874200 --pose_estimation_json '/tmp' --cache_on_fail False pose_frame_000000000070 thanks

ArashHosseini avatar Jul 04 '19 20:07 ArashHosseini

Awesome, thank you, but now my 3d_data.json is empty in my maya folder, whereas there is a 2d_data.json that is not.

3d_data - Copy.txt 2d_data - Copy.txt

adampelah avatar Jul 04 '19 20:07 adampelah

@adampelah , remove line 393 and move the if body back like:

            #if not poses3d is None:
            to_export = poses3d.tolist()[0]
            x,y,z = [[] for _ in range(3)]
            for o in range(0, len(to_export), 3):
                x.append(to_export[o])
                y.append(to_export[o+1])
                z.append(to_export[o+2])
            export_units[frame]={}
            for jnt_index, (_x, _y, _z) in enumerate(zip(x,y,z)):
                export_units[frame][jnt_index] = {"translate": [_x, _y, _z]}


                viz.show3Dpose(p3d, ax, lcolor="#9b59b6", rcolor="#2ecc71")

2d_3d.zip

ArashHosseini avatar Jul 04 '19 20:07 ArashHosseini

Hi, getting this error again:

heckpoint-4874200 I0704 22:02:46.833290 7980 openpose_3dpose_sandbox.py:317] calc frame 0/248 Traceback (most recent call last): File "src/openpose_3dpose_sandbox.py", line 448, in tf.app.run() File "C:\Users\adamp\Anaconda3\envs\tfopenpose\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "C:\Users\adamp\Anaconda3\envs\tfopenpose\lib\site-packages\absl\app.py", line 300, in run _run_main(main, args) File "C:\Users\adamp\Anaconda3\envs\tfopenpose\lib\site-packages\absl\app.py", line 251, in _run_main sys.exit(main(argv)) File "src/openpose_3dpose_sandbox.py", line 394, in main to_export = poses3d.tolist()[0] AttributeError: 'NoneType' object has no attribute 'tolist'

adampelah avatar Jul 04 '19 21:07 adampelah

@adampelah , try it with

            p3d = poses3d
            logger.info("frame score {0}".format(np.min(poses3d)))
            x,y,z = [[] for _ in range(3)]
            if not poses3d is None:
                to_export = poses3d.tolist()[0]
            else:
                to_export = [0.0 for _ in range(96)]
            logger.info("export {0}".format(to_export))
            for o in range(0, len(to_export), 3):
                x.append(to_export[o])
                y.append(to_export[o+1])
                z.append(to_export[o+2])

            export_units[frame]={}
            for jnt_index, (_x, _y, _z) in enumerate(zip(x,y,z)):
                export_units[frame][jnt_index] = {"translate": [_x, _y, _z]}
                viz.show3Dpose(p3d, ax, lcolor="#9b59b6", rcolor="#2ecc71")

let it me know how its end please. thx

ArashHosseini avatar Jul 04 '19 21:07 ArashHosseini

This is how that ends:

Traceback (most recent call last): File "src/openpose_3dpose_sandbox.py", line 448, in tf.app.run() File "C:\Users\adamp\Anaconda3\envs\tfopenpose\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "C:\Users\adamp\Anaconda3\envs\tfopenpose\lib\site-packages\absl\app.py", line 300, in run _run_main(main, args) File "C:\Users\adamp\Anaconda3\envs\tfopenpose\lib\site-packages\absl\app.py", line 251, in _run_main sys.exit(main(argv)) File "src/openpose_3dpose_sandbox.py", line 408, in main viz.show3Dpose(p3d, ax, lcolor="#9b59b6", rcolor="#2ecc71") File "C:\Users\adamp\Desktop\3dtfpose\3d-pose-baseline\src\viz.py", line 25, in show3Dpose assert channels.size == len(data_utils.H36M_NAMES)*3, "channels should have 96 entries, it has %d instead" % channels.size AttributeError: 'NoneType' object has no attribute 'size'

So at least it's getting past tolist now

adampelah avatar Jul 04 '19 21:07 adampelah

Pose3d is none for this frame, p3d also. Please upload the images and jsons please, we can not do much about it, we need better skeleton in frame

ArashHosseini avatar Jul 04 '19 22:07 ArashHosseini

How is this for a dataset? Was in T-pose for a couple of seconds

tmp2.zip

update: For the above set, I removed the nulls and I have output in 3d_maya,

side note, if i dont remove "ax.set_aspect('equal')" from viz.py (line 55), I get this error:

'It is not currently possible to manually set the aspect ' NotImplementedError: It is not currently possible to manually set the aspect on 3D axes

I assume this is just a visualization error.

Below is the updated keypoints anfd resulting 3d coordinates file: tmp2.zip

3d_data.zip

How could I split the arrays in the 3d_data to joint centers such as leftankle: X, Y, Z, righthip: X, Y, Z etc. ?

adampelah avatar Jul 04 '19 22:07 adampelah

data.zip Hi, when i run python35.exe src/openpose_3dpose_sandbox.py --camera_frame --residual --batch_norm --dropout 0.5 --max_norm --evaluateActionWise --use_sh --epochs 200 --pose_estimation_json "D:\\Download\\out_data\\test" --verbose 3 --interpolation

pose_estimation_json is data.zip file

tip as follows : image

that happen in 9_keypoints.json some where .

when i delete 1~9 keypoints.json file

D:\\Download\\out_data\\test just only have 10~20 keypoints.json file

image

output_2d_and_3d_json.zip

the generate 109 object . why not 10?

image

thank you. @ArashHosseini

Montage-LSM avatar Jul 05 '19 02:07 Montage-LSM

@Montage-LSM i think frame 0 is missing, try to rename your json files with 0 like str(0).zfill(12).json or where are json's coming from? Naming convention looks like: 000000000000_keypoints.json, 000000000001_keypoints.json, ... 109 object's are coming from the usage of the --interpolation flag, see in folder gif_output for png graphs, remove it to keep all thx

ArashHosseini avatar Jul 05 '19 08:07 ArashHosseini

hi @adampelah ,i am running tmp2.zip with

            p3d = poses3d
            logger.info("frame score {0}".format(np.min(poses3d)))
            x,y,z = [[] for _ in range(3)]
            if not poses3d is None:
                to_export = poses3d.tolist()[0]
            else:
                to_export = [0.0 for _ in range(96)]
            logger.info("export {0}".format(to_export))
            for o in range(0, len(to_export), 3):
                x.append(to_export[o])
                y.append(to_export[o+1])
                z.append(to_export[o+2])

            export_units[frame]={}
            for jnt_index, (_x, _y, _z) in enumerate(zip(x,y,z)):
                export_units[frame][jnt_index] = {"translate": [_x, _y, _z]}
                viz.show3Dpose(p3d, ax, lcolor="#9b59b6", rcolor="#2ecc71")

and python3.5 src/openpose_3dpose_sandbox.py --camera_frame --residual --batch_norm --dropout 0.5 --max_norm --evaluateActionWise --use_sh --epochs 200 --load 4874200 --pose_estimation_json '/tmp2' its running through pose_frame_000000000022

How could I split the arrays in the 3d_data to joint centers such as leftankle: X, Y, Z, righthip: X, Y, Z etc. ?

can you explain this one little more please, because its already like this. See https://github.com/ArashHosseini/3d-pose-baseline/blob/c50136745e744321db7700f066ddcd454e55d3b2/maya/maya_skeleton.py#L122 joint leftankle is nr. 8 and righthip is nr. 1, so in the 3d_json data[frame_id][8]["translate"] is the leftankle center pos. You do not really need to make a t-pose, it is important that all body parts are recognized at the beginning of the recording, that was my point. thx

ArashHosseini avatar Jul 05 '19 08:07 ArashHosseini

hi ,i can't run python .\maya\maya_skeleton.py

because, maya module not true install. no matter python2.7 、 python3.5 、 python3.6 code: import maya.cmds as cmds import maya.OpenMaya as om

will ↓↓↓ No module named cmds No module named OpenMaya

Can you write it in another module? or

How could I split the arrays in the 3d_data to joint centers such as leftankle: X, Y, Z, righthip: X, Y, Z etc. ? question. More detailed description. like

CMD-openpose-output.md#keypoint-ordering

thk @ArashHosseini

Montage-LSM avatar Jul 05 '19 13:07 Montage-LSM

Hi Arash, thanks for the help.

How does 3d-pose-baseline deal with two or more people in view? Also, am I correct in assuming that if no data is detected for any frame that the program will not run through, as indicated by the following error:

File "src/openpose_3dpose_sandbox.py", line 56, in read_openpose_json _data = data["people"][0]["pose_keypoints_2d"] if "pose_keypoints_2d" in data["people"][0] else data["people"][0]["pose_keypoints"] IndexError: list index out of range

@ArashHosseini

adampelah avatar Jul 11 '19 14:07 adampelah

hi ,i can't run python .\maya\maya_skeleton.py

because, maya module not true install. no matter python2.7 、 python3.5 、 python3.6 code: import maya.cmds as cmds import maya.OpenMaya as om

will ↓↓↓ No module named cmds No module named OpenMaya

I can't run too, even in maya, have you solved it yet?

Sunloggy avatar Jul 20 '19 04:07 Sunloggy

嗨,我不能跑 python .\maya\maya_skeleton.py 因为,maya模块没有真正安装。 无论是python2.7,python3.5,python3.6 代码: import maya.cmds as cmds import maya.OpenMaya as om 将↓↓↓ No module named cmds No module named OpenMaya

我不能跑,即使在玛雅,你解决了吗?

I've given up Maya ,use other way to Solve ,2D to 3D . my QQ: 564303494 you can Add to me. chines.

Montage-LSM avatar Jul 20 '19 11:07 Montage-LSM

@Montage-LSM, @Sunlolo hi, the 3D information is already included in 3d_json file. Maya is a dcc application, the maya_skeleton.py file is Reading the information from the json and will build the skeleton incl. animation inside maya. So the 3D information already exists, how to visualize them need your own implementation. In this example I used maya but you can use any application which supports 3D space

ArashHosseini avatar Jul 20 '19 13:07 ArashHosseini

I had 3d_data. json file with the information of animation inside. But the code maya_skeleton.py not work. No error, no result. Look like I have to watch an ice cream melt down but i cant eat:((( huhu. Pls help me. The maya_skeleton.py say : #for 3d use 3d_data.json and set three_dim to True input_json_path = [os.path.join(threed_pose_baseline, "maya/{0}.json".format(_data)) for _data in ["3d_data", "2d_data"]] # replace it with abs path like "/path/to/2d_data.json" "set three_dim to True" like threed=True or something:(( could you show me an example code for this line, thanks.

Sunloggy avatar Jul 20 '19 14:07 Sunloggy

Ohh, I've just used other solution, it works but I have to polish more on other DDC! Thanks all!

Sunloggy avatar Jul 21 '19 05:07 Sunloggy