facebookresearch / DensePose

A real-time approach for mapping all human pixels of 2D RGB images to a 3D surface-based model of the body
http://densepose.org
Other
6.98k stars 1.3k forks source link

Is this support python3? #54

Open universewill opened 6 years ago

universewill commented 6 years ago

Is this support python3? I notice that the demo cmd is all python2.

vkhalidov commented 6 years ago

the code is not guaranteed to work with Python 3

landersson commented 6 years ago

In case someone might find it useful, I just created a fork with a branch called python3, containing the changes I needed to make to start training using python3:

https://github.com/landersson/DensePose/tree/python3

This is not well tested, but at least train_net.py seems to be working...

kekedan commented 5 years ago

In case someone might find it useful, I just created a fork with a branch called python3, containing the changes I needed to make to start training using python3:

https://github.com/landersson/DensePose/tree/python3

This is not well tested, but at least train_net.py seems to be working...

thanks for the code,I compile it successfully,but when run the code ,there are som problm:

CUDA_VISIBLE_DEVICES=3 python tools/infer_simple.py \ --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml \ --output-dir DensePoseData/infer_out/ \ --image-ext jpg \ --wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl \ DensePoseData/demo_data/demo_im.jpg

Found Detectron ops lib: /root/anaconda3/envs/AIdance/lib/libcaffe2_detectron_ops_gpu.so E1229 18:38:25.510565 119887 init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E1229 18:38:25.510648 119887 init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E1229 18:38:25.510828 119887 init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. WARNING cnn.py: 25: [====DEPRECATE WARNING====]: you are creating an object from CNNModelHelper class which will be deprecated soon. Please use ModelHelper object with brew module. For more information, please refer to caffe2.ai and python/brew.py, python/brew_test.py for more information. INFO net.py: 51: Loading weights from: /root/dance/densepose/model/DensePose_ResNet101_FPN_s1x-e2e.pkl I1229 18:38:27.143235 119887 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 0.000185281 secs I1229 18:38:27.143592 119887 net_dag.cc:46] Number of parallel execution chains 36 Number of operators = 371 I1229 18:38:27.162335 119887 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 0.000172346 secs I1229 18:38:27.162598 119887 net_dag.cc:46] Number of parallel execution chains 30 Number of operators = 358 I1229 18:38:27.164830 119887 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 1.9383e-05 secs I1229 18:38:27.164917 119887 net_dag.cc:46] Number of parallel execution chains 10 Number of operators = 30 INFO infer_simple.py: 106: Processing DensePoseData/demo_data/demo_im.jpg -> DensePoseData/infer_out/demo_im.jpg.pdf E1229 18:38:28.133205 119989 net_dag.cc:195] Exception from operator chain starting at '' (type 'Conv'): caffe2::EnforceNotMet: [enforce fail at blob.h:84] IsType(). wrong type for the Blob instance. Blob contains nullptr (uninitialized) while caller expects caffe2::Tensor . Offending Blob name: gpu_0/rois_fpn4. Error from operator: input: "gpu_0/fpn_res4_22_sum" input: "gpu_0/rois_fpn4" output: "gpu_0/roi_feat_fpn4" name: "" type: "RoIAlign" arg { name: "pooled_w" i: 7 } arg { name: "pooled_h" i: 7 } arg { name: "spatial_scale" f: 0.0625 } arg { name: "sampling_ratio" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } E1229 18:38:28.133239 119987 net_dag.cc:195] Secondary exception from operator chain starting at '' (type 'RoIAlign'): caffe2::EnforceNotMet: [enforce fail at blob.h:84] IsType(). wrong type for the Blob instance. Blob contains nullptr (uninitialized) while caller expects caffe2::Tensor . Offending Blob name: gpu_0/rois_fpn5. Error from operator: input: "gpu_0/fpn_res5_2_sum" input: "gpu_0/rois_fpn5" output: "gpu_0/roi_feat_fpn5" name: "" type: "RoIAlign" arg { name: "pooled_w" i: 7 } arg { name: "pooled_h" i: 7 } arg { name: "spatial_scale" f: 0.03125 } arg { name: "sampling_ratio" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } E1229 18:38:28.135134 119990 net_dag.cc:195] Secondary exception from operator chain starting at '' (type 'Conv'): caffe2::EnforceNotMet: [enforce fail at blob.h:84] IsType(). wrong type for the Blob instance. Blob contains nullptr (uninitialized) while caller expects caffe2::Tensor . Offending Blob name: gpu_0/rois_fpn3. Error from operator: input: "gpu_0/fpn_res3_3_sum" input: "gpu_0/rois_fpn3" output: "gpu_0/roi_feat_fpn3" name: "" type: "RoIAlign" arg { name: "pooled_w" i: 7 } arg { name: "pooled_h" i: 7 } arg { name: "spatial_scale" f: 0.125 } arg { name: "sampling_ratio" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } WARNING workspace.py: 185: Original python traceback for operator 359 in network generalized_rcnn in exception above (most recent call last): WARNING workspace.py: 190: File "tools/infer_simple.py", line 143, in WARNING workspace.py: 190: File "tools/infer_simple.py", line 94, in main WARNING workspace.py: 190: File "/root/DensePose/detectron/core/test_engine.py", line 334, in initialize_model_from_cfg WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/model_builder.py", line 119, in create WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/model_builder.py", line 84, in generalized_rcnn WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/model_builder.py", line 233, in build_generic_detection_model WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/optimizer.py", line 46, in build_data_parallel_model WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/model_builder.py", line 200, in _single_gpu_build_func WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/model_builder.py", line 258, in _add_fast_rcnn_head WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/fast_rcnn_heads.py", line 103, in add_roi_2mlp_head WARNING workspace.py: 190: File "/root/DensePose/detectron/modeling/detector.py", line 268, in RoIFeatureTransform Traceback (most recent call last): File "tools/infer_simple.py", line 143, in main(args) File "tools/infer_simple.py", line 112, in main model, im, None, timers=timers File "/root/DensePose/detectron/core/test.py", line 58, in im_detect_all model, im, cfg.TEST.SCALE, cfg.TEST.MAX_SIZE, boxes=box_proposals File "/root/DensePose/detectron/core/test.py", line 158, in im_detect_bbox workspace.RunNet(model.net.Proto().name) File "/root/anaconda3/lib/python3.6/site-packages/caffe2/python/workspace.py", line 217, in RunNet StringifyNetName(name), num_iter, allow_fail, File "/root/anaconda3/lib/python3.6/site-packages/caffe2/python/workspace.py", line 178, in CallWithExceptionIntercept return func(*args, **kwargs) RuntimeError: [enforce fail at blob.h:84] IsType(). wrong type for the Blob instance. Blob contains nullptr (uninitialized) while caller expects caffe2::Tensor . Offending Blob name: gpu_0/rois_fpn4. Error from operator: input: "gpu_0/fpn_res4_22_sum" input: "gpu_0/rois_fpn4" output: "gpu_0/roi_feat_fpn4" name: "" type: "RoIAlign" arg { name: "pooled_w" i: 7 } arg { name: "pooled_h" i: 7 } arg { name: "spatial_scale" f: 0.0625 } arg { name: "sampling_ratio" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 }

Do you have any advice ? thanks!

stimong commented 5 years ago

https://github.com/stimong/densepose_python3.git