Open turpaultn opened 5 years ago
@turpaultn Where did you obtain the vggish_model.ckpt.meta file?
Good question, I actually ran the code "vggish_inference_demo.py" from their repo, and I have added this after the line 121 (after the sess.run(...))
if FLAGS.output_model:
saver = tf.train.Saver()
save_path = saver.save(sess, "./vggish_model.ckpt")
I defined a flag after theirs:
flags.DEFINE_string(
'output_model', None,
'Path the saved_model')
Great, thank you for this! Super helpful. Just tested it and it worked great with one small change. I had to update the None
value to a string (or something that would return True
).
flags.DEFINE_string( 'output_model', True, 'Path the saved_model')
Thank you!
Platform (macOs High Sierra): Python version: 3.5 Source: Tensorflow 1.12 Destination: Pytorch 1.0.1 Pre-trained model path (webpath or webdisk path): VGG model pretrained on Audioset (More about the model in audioset repo)
Thank you for you work !! I finally succeeded to convert Vgg model from tensorflow to pytorch after issues about dimensions.
There is no error when running commands:
At runtime, using the model like this didn't give me the same output I had in tensorflow.
After investigating layer by layer, the problem comes from the dimensions:
FYI, the convolution layers had the same output, but not the linear layers, that's how I found the issue.
The created file (only the forward where you can see the potential errors):
I updated it as follow:
Now everything works as expected. Thanks again for your tool !! 👍