@ildoonet I am trying to reproduce original paper results based on your suggestion using vgg model. I have downlaoded openpose_vgg16.npy directly from (www.mediafire.com). which is 89.0 MB but when it load the network in (net.load()). In network_base.py gives error.
I checked numpy file the network network_cmu.py has different layers names than the one used in vgg file openpose_vgg16.npy. I think this is the reason I can not load the weights reading from dictionary in numpy file. Could you please advice?
Also I tried training using "cmu". using suggested hyperparameters. only using 32 mibinatch size. because I did not have enough GPU memory for 64. it seems the training loss is quiet noisy and does not decrease well.
I am using learning rate 0.0001 and minibatch=32 how many iterations should give reasonable results? any other hyperparameters I need to change?
I am aware in original paper they use vgg network and "cmu" and "vgg" are also same network. why they are two options then? Thanks!
I am facing the same problem with training with "vgg". The error msg is
Traceback (most recent call last):
File "train_local.py", line 190, in <module>
net.load(pretrain_path, sess, False)
File "/root/tf-openpose/src/network_base.py", line 87, in load
with tf.variable_scope(op_name, reuse=True):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variable_scope.py", line 1780, in __enter__
raise TypeError("VariableScope: name_or_scope must be a string or "
TypeError: VariableScope: name_or_scope must be a string or VariableScope.
Training with "cmu" looks fine though.
Any hints are appreciated!
@muchuanyun I meet the same problem with you, have you solved it ?
@muchuanyun @sarahzhouUestc
I think, I found the solution for this problem. In openpose_vgg16.npy items name saved as bytes not str, so there are two ways to solve it. Change type in directly in .npy file, or make several changes in network_base.py.
line 87: op_name => op_name.decode("utf-8")
line 90: param_name.decode("utf-8") => param_name
Also layers "conv5_1", "conv5_2", "conv4_3" don't exist in network, so you should delete them from .npy file
@scizzzo
I had a similar issue and tried modifying the .npy file using the below code. However, despite the datatypes seeming to be identical, the encoding in the .npy file doesn't seem to be the same and the code throws the following error.
ValueError: Variable conv5_3/biases does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?
arr = np.load('openpose_vgg16_old.npy')
dict_ = arr.tolist()
del dict_['conv5_1']
del dict_['conv5_2']
del dict_['conv4_3']
npy = np.array(dict, dtype = object)
np.save('openpose_vgg16.npy', npy)
All print and type tests seem to fine and exactly what I want.
Any help as to what I might be doing wrong while modifying the .npy file will be great.
I generated a vgg19.npy from vgg19 model as the paper says it uses vgg19 instead of vgg16.
If anyone has problem in using vgg parameters as initial point for training, you can download this file for use.
Anyone replicate the results as in Caffe?
I am still facing this. Anyone could make it work.
Most helpful comment
@muchuanyun @sarahzhouUestc
I think, I found the solution for this problem. In openpose_vgg16.npy items name saved as bytes not str, so there are two ways to solve it. Change type in directly in .npy file, or make several changes in network_base.py.
line 87: op_name => op_name.decode("utf-8")
line 90: param_name.decode("utf-8") => param_name
Also layers "conv5_1", "conv5_2", "conv4_3" don't exist in network, so you should delete them from .npy file