DeNA / Chainer_Realtime_Multi-Person_Pose_Estimation

Chainer version of Realtime Multi-Person Pose Estiamtion
Other
431 stars 94 forks source link

errors when converting caffemodel to chainer parameters #12

Closed zeyuanlicbpm closed 6 years ago

zeyuanlicbpm commented 6 years ago

I install Chainer in windows 10 and anaconda virtual environment, and import chainer successfully. But, I met the information:

  1. "path\to\chainer\links\caffe\caffe_function.py:118: UserWarning: Skip the layer "data", since CaffeFunction does notsupport CPMData layer"
  2. " path\to\chainer\links\caffe\caffe_function.py:118: UserWarning: Skip the layer "loss_stage6", since CaffeFunction does notsupport EuclideanLoss layer" then, output : Succeed to copy layer conv1_1 ... Succeed to copy layer conv4_2 Traceback (most recent call last): File "convert_pose_model.py", line 132, in copy_conv_layer_weights(chainer_model, caffe_model, layer_name) File "convert_pose_model.py", line 7, in copy_conv_layer_weights if eval("chainer_model.%s.b.shape == caffe_model['%s'].b.shape" % (layer_name, layer_name)) and eval("chainer_model.%s.W.shape == caffe_model['%s'].W.shape" % (layer_name, layer_name)): File "", line 1, in File "D:\public\Anaconda\envs\tensorflow\lib\site-packages\chainer\link.py", line 653, in getitem return getattr(self, name) AttributeError: 'CaffeFunction' object has no attribute 'conv4_3_CPM'

I just guess the reason is that there is no cpm layers when you compile the caffe interface. Can you tell me the reason? how I can solve the problems! thanks!!!!

zeyuanlicbpm commented 6 years ago

when I execute the python convert_pose_model.py pose_iter_116000.caffemodel met the above errors

leetenki commented 6 years ago

That's wrong file. You should use convert_face_model.py to convert that face model.

zeyuanlicbpm commented 6 years ago

Oh, I know! thank you! but why thers is the warnings "since CaffeFunction does notsupport EuclideanLoss layer" ?

leetenki commented 6 years ago

It is because loss layer and data layer in chainer is not defined as "Link".

But we don't use those functions in inference, so don't care.

zeyuanlicbpm commented 6 years ago

thank you!!!

leetenki commented 6 years ago

By the way, I updated convert_model.py script and README. You can use the new version of script like following.

cd models
wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel
wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/face/pose_iter_116000.caffemodel
wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel
python convert_model.py posenet pose_iter_440000.caffemodel coco_posenet.npz
python convert_model.py facenet pose_iter_116000.caffemodel facenet.npz
python convert_model.py handnet pose_iter_102000.caffemodel handnet.npz
cd ..
zeyuanlicbpm commented 6 years ago

OK! compared with Caffe or tensorflow, the speed of chainer is faster in the same environment ?

leetenki commented 6 years ago

Em...I have not tried Caffe and tensorflow version yet, so I'm not sure which one is better. But I think the original Caffe version is the fastest because it is written with C.