OK, I thought I had the tfjs model working but I think I may have just
missed an error message and didn't actually check that the midi wasn't
garbage. I had something else go wrong and had to rebuild my env and gpu
driers (sigh) and now I think I have the various errors sorted out,
matching my original ones:
When I use the tfjs model, I get:
Could not find trained model in model_dir: /path/to/model/tfjs, running initialization to predict.
This
still produces a midi, but its just noise.
Is there anything special I
need to do to get it to recognize the tfjs model format? The model_dir is the directory containing the shards and weights_manifest.json file right?
So if the tfjs model won't work I thought I'd go back to the unidirectional checkpoint from:
I get different errors depending on hparams:
$ onsets_frames_transcription_transcribe -\
--model_dir=/path/onsets_uni_model \
--checkpoint_path=/path/onsets_uni_model/model.ckpt-583632 \
--hparams="bidirectional=False,use_cudnn=True" \
piano.wav
Results in:
(0) Not found: Key offsets/conv0/BatchNorm/beta not found in checkpoint
[[node save/RestoreV2 (defined at /lib/python2.7/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]
(1) Not found: Key offsets/conv0/BatchNorm/beta not found in checkpoint
[[node save/RestoreV2 (defined at /lib/python2.7/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]
[[save/RestoreV2/_3]]
If I change to use_cudnn=True:
(0) Not found: Key
frame/cudnn_lstm/stack_bidirectional_rnn/cell_0/bidirectional_rnn/bw/cudnn_compatible_lstm_cell/bias
not found in checkpoint
[[node save/RestoreV2 (defined at /lib/python2.7/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]
(1) Not found: Key
frame/cudnn_lstm/stack_bidirectional_rnn/cell_0/bidirectional_rnn/bw/cudnn_compatible_lstm_cell/bias
not found in checkpoint
[[node save/RestoreV2 (defined at /lib/python2.7/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]
[[save/RestoreV2/_149]]
I believe this last error may be from model.py: lstm_layer():
if use_cudnn:
...
else:
...
with tf.variable_scope('cudnn_lstm'):
(outputs, unused_state_f,
unused_state_b) = tf.contrib.rnn.stack_bidirectional_dynamic_rnn(...)
Which seems odd to use a bidirectional rnn if cudnn==False? (I can write up a github issue for this if you like?)
So
assuming cudnn=True is correct, if I look at the uni model using
inspect_checkpoint.py I don't see any variables under offsets (frame,
onsets, and velocity only).
So was this model made before the commit when offsets were added? Seems strange the model would only do onsets.
So forget about this model or is there someway to easily rescue it?
Sorry for all the questions, but hopefully solving this will help others too.
Thanks again!
Ryan