Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue using converted vnect.pkl #11

Open
mlasy opened this issue May 29, 2018 · 13 comments
Open

issue using converted vnect.pkl #11

mlasy opened this issue May 29, 2018 · 13 comments

Comments

@mlasy
Copy link

mlasy commented May 29, 2018

i converted the caffemodel using the caffe_weights_to_pickle.py.
however, when i want to load the vnect.pkl with tensorflow, i get:
DataLossError (see above for traceback): Unable to open table file models/weights/vnect_tf: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?

thanks for any help

@yukaliu07
Copy link

yukaliu07 commented Jun 6, 2018

check vnect_model.py in the models folder. There's a function called "load_weights" and you could use saver.save to get vnect_tf.

@lavage
Copy link

lavage commented Jun 27, 2018

@yukaliu07 could you maybe provide some more detail on how to use saver.save? I have implemented it as follows, but the model files that this returns, give me wrong results:

with tf.Session() as sess:
    saver = tf.train.Saver()
    tf_writer = tf.summary.FileWriter(logdir='./', graph=sess.graph)

    sess.run(tf.global_variables_initializer())
    saver.save(sess, './vnect_tf')
    print(model.res5b_branch2c_new)
    print(model.heatmap, model.x_heatmap, model.y_heatmap, model.z_heatmap)

@yukaliu07
Copy link

@lavage
with tf.Session() as sess: saver = tf.train.Saver() model.load_weights(sess, model_file) save_path = saver.save(sess, "./vnect_tf")

@powermew
Copy link

powermew commented Jul 3, 2018

@yukaliu07 @lavage
Thank you so much!! It perfectly solved my problem. :D

@fenglupeter
Copy link

@yukaliu07
I use the code but the pkl can't convert correctly.
Error message:
Traceback (most recent call last):
File "models/vnect_model.py", line 175, in
model = VNect(368)
File "models/vnect_model.py", line 13, in init
self._create_network()
File "models/vnect_model.py", line 94, in _create_network
self.res4d_branch2a = tc.lvnectayers.conv2d(self.res4c, kernel_size=1, num_outputs=256, scope='res4d_branch2a')
AttributeError: 'module' object has no attribute 'lvnectayers'

@Robinchacko
Copy link

Robinchacko commented Sep 27, 2018

@yukaliu07 @powermew @lavage

Hello,
I had tried this code with these follows.

1.Download weights from the author of paper
2.change weights with using './caffe_weight_to_pickle.py'
  1. run '/models/vnect_model.py' to get

vnect_tf.data-00000-of-00001
vnect_tf.index
vnect_tf.meta

run '/demo_tf.py'

But I am getting an error like this
2018-09-27 16:11:48.784541: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open models/weights/vnect_tf: Failed precondition: models/weights/vnect_tf; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator?

I have tried editing vnect_model.py file as per

@lavage
with tf.Session() as sess: saver = tf.train.Saver() model.load_weights(sess, model_file) save_path = saver.save(sess, "./vnect_tf")

But I couldn't solve the problem, Can someone help me with this

@powermew
Copy link

@Robinchacko
At step 3 on your method, i guess you should fix the location of model file in demo_tf.py

@powermew
Copy link

powermew commented Sep 28, 2018

I changed code line 173-181 in vnect_tf.py

if __name__ == '__main__':
    model_file = 'vnect.pkl'
    model = VNect(368)

    with tf.Session() as sess:
        saver = tf.train.Saver()
        model.load_weights(sess, model_file)
        save_path = saver.save(sess, "./vnect_tf")

And also changed line 21 in demo_tf.py

parser.add_argument('--model_file', default='models/weights/vnect_tf')

This was referenced Nov 17, 2018
@musab1234
Copy link

can any one provide model files please? [email protected] , author is not replying.

@rafikg
Copy link

rafikg commented Feb 25, 2019

@musab1234,
Hi, did you get the model files? Could you share it?

@faybak
Copy link

faybak commented Apr 10, 2019

Can you send your weight and model files?I have sent a email to the author since last week, but he haven't replied yet. my email is [email protected]

@linche1
Copy link

linche1 commented Dec 8, 2020

can you send the weight and model file? much appreciation!! [email protected]

@NewCoderQ
Copy link

Can you send the weight and the model file? Much appreciation!! [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests