Closed ting3000 closed 4 years ago
Sorry, not sure why Python 3.6 doesn't work while 2.7 does, that's definitely something they changed, we mostly use 2.X. PRs are welcome!
Hello, I want to train hand-detector with hand dataset-lmdb separately without training the other models, but there are following lines in d_setLayers.py :
"if sAddHands: if len(sLmdbFolders) != 6: print('Not prepared for this case') assert(False)"
And there are following lines in the training/README.md:
"Set sAddFoot to 1 or 0 to enable/disable combined body-foot. Set sAddMpii, sAddFace and sAddHands to 1 or 0 to enable/disable boyd mpii/face/hands (if 1, then all the above must be also 1)."
How can I realize my needs?
@ting3000 you can change "generateProtoTxt.py" line 13 & 14 like below for running with python 3
sLabelName = ['label_heat', 'label_vec', 'label_dist', 'heat_weight', 'vec_weight', 'dist_weight', 'heat_temp', 'vec_temp', 'dist_temp'] sLNSize = len(sLabelName)//3
instead of
sLNSize = len(sLabelName)/3
so that the variable will be an int one.
I followed the training/README.md file to build the code including Caffe on the Ubuntu 18.0.4 box.
After I fixed the syntax error for some print statements in d_setLayers.py and generateProtoTxt.py, I run "python3 d_setLayers.py", it reported the following error: /openpose_train-master/training_results/pose /openpose_train-master/dataset/vgg/VGG_ILSVRC_19_layers.caffemodel Traceback (most recent call last): File "d_setLayers.py", line 643, in
sDistanceChannels, not sAddMpii)
File "/openpose_train-master/training/generateProtoTxt.py", line 30, in generateProtoTxt
addBkgChannel)
File "/openpose_train-master/training/generateProtoTxt.py", line 179, in setLayersTwoBranches
ntop=4
TypeError: list indices must be integers or slices, not float
But if I built code (including Caffe) with python2.7.17, I execute "python d_setLayers.py" successfully.
What is is the cause of the failure of python3.6.9 execution?
Thanks!