ZheC / Realtime_Multi-Person_Pose_Estimation

Code repo for realtime multi-person pose estimation in CVPR'17 (Oral)
Other
5.09k stars 1.37k forks source link

When use setLayers.py, AttributeError: 'LayerParameter' object has no attribute 'cpm_transform_param' #2

Closed fengshikun closed 7 years ago

fengshikun commented 7 years ago

Hello, i want to train a model follow your training steps, when execute "python setLayers.py --exp 1", Generate errors likes this:

Traceback (most recent call last):
  File "setLayers.py", line 488, in <module>
    writePrototxts(dataFolder, sub_dir, batch_size, layername, kernel, stride, outCH, transform_param, base_lr, d_caffemodel, label_name, 0, lr_mult_distro, 6)
  File "setLayers.py", line 308, in writePrototxts
    str_to_write = setLayers_twoBranches(source, batch_size, layername, kernel, stride, outCH, label_name, transform_param_in, deploy=False, batchnorm=batchnorm, lr_mult_distro=lr_mult_distro)
  File "setLayers.py", line 292, in setLayers_twoBranches
    return str(n.to_proto())
  File "/home/kunkun/DL/pose_estimate/caffe_train/python/caffe/net_spec.py", line 183, in to_proto
    top._to_proto(layers, names, autonames)
  File "/home/kunkun/DL/pose_estimate/caffe_train/python/caffe/net_spec.py", line 97, in _to_proto
    return self.fn._to_proto(layers, names, autonames)
  File "/home/kunkun/DL/pose_estimate/caffe_train/python/caffe/net_spec.py", line 152, in _to_proto
    assign_proto(layer, k, v)
  File "/home/kunkun/DL/pose_estimate/caffe_train/python/caffe/net_spec.py", line 64, in assign_proto
    is_repeated_field = hasattr(getattr(proto, name), 'extend')
AttributeError: 'LayerParameter' object has no attribute 'cpm_transform_param'

Looking forward to your help, Thanks!

kevin-ssy commented 7 years ago

You need to compile the train-caffe provided by the author rather than using the official caffe. They implemented their own cpm_data_layer.

fengshikun commented 7 years ago

@kevin-ssy ,Thanks for your reply! However, I have used the author's caffe(https://github.com/CMU-Perceptual-Computing-Lab/caffe_train.git), and set the caffe root to this, and then this error occurs :(

kevin-ssy commented 7 years ago

Have you made the pycaffe? You need to set your caffe root dir to caffe_dir + '/python'. More information about compiling pycaffe please refer to http://caffe.berkeleyvision.org/installation.html#compilation

fengshikun commented 7 years ago

Yes, I have made the pycaffe wrapper, and I just change a segment of code in setLayers.py to this:

caffe_path = '/home/kunkun/DL/pose_estimate/caffe_train'
#caffe_path = '/media/ssd/humanPose/caffe/'
import sys, os
sys.path.insert(0, os.path.join(caffe_path, 'python'))
import caffe

The directory '/home/kunkun/DL/pose_estimate/caffe_train' is where I clone the project "(https://github.com/CMU-Perceptual-Computing-Lab/caffe_train.git)"

fengshikun commented 7 years ago

I have searched the string "cpm_transform_param" in the project https://github.com/CMU-Perceptual-Computing-Lab/caffe_train.git and find nothing...

kevin-ssy commented 7 years ago

Yes, I found there's no such parameter defined in caffe.proto. Maybe the author just tried before and deleted them all, as they only use the data in coco and I guess such transformation is to transform the data in MPII pose dataset. I found the param transform_param contains all the flags required by coco. You may delete all the code related to cpm_transform_param and use transform_param for transformation instead.

kevin-ssy commented 7 years ago

@ZheC Could you please check the bug mentioned above?

fengshikun commented 7 years ago

@kevin-ssy ,Thanks!

NIEYALI commented 7 years ago

@ZheC I met same problem. Have you solved it? Thanks a lot

ZheC commented 7 years ago

@fengshikun @NIEYALI @kevin-ssy Thank you for reporting those issues. I have fixed them with an updated caffe_train(https://github.com/CMU-Perceptual-Computing-Lab/caffe_train). Also, it uses a newer version of caffe so that it is compatible with CUDA 7.5/ 8.0 and cudnn v5. Let me know if you meet other issues.

soveidadelgarmi commented 5 years ago

@ZheC Thank you for your kind explanation. I had the same problem for weeks and I download the updated caffe_train(https://github.com/CMU-Perceptual-Computing-Lab/caffe_train). but it doesn't fix and I have the same problem again when using setlayer.py. Can I ask you to share the build version of this caffe_train? Or the output files after running setlayer.py?