magenta / magenta

Magenta: Music and Art Generation with Machine Intelligence
Apache License 2.0
19.18k stars 3.74k forks source link

Can't run Onset Frames Transcription #1628

Closed maulic32768 closed 4 years ago

maulic32768 commented 4 years ago

I'm not sure if I'm doing something wrong, but I can't figure out how to run onsets_frames_transcription_transcribe. Any help would be very much appreciated!

I've tried pip install magenta and the full Development Environment.

Then I tried to run Onset Frames Transcription as follows:

MODEL_DIR=train
onsets_frames_transcription_transcribe --model_dir="${CHECKPOINT_DIR}" /Users/klt/Desktop/tmp/p.wav

I get this output:

/Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/librosa/__init__.py:35: FutureWarning: You are using librosa with Python 2. Please note that librosa 0.7 will be the last version to support Python 2, after which it will require Python 3 or later.
  FutureWarning)
WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py:12: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.

W1123 20:41:19.349154 4733580736 module_wrapper.py:139] From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py:12: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:136: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.

W1123 20:41:20.726474 4733580736 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:136: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:626: output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
W1123 20:41:27.954725 4733580736 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:626: output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
WARNING:tensorflow:Using temporary folder as model directory: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpolFdbX
W1123 20:41:27.996778 4733580736 estimator.py:1821] Using temporary folder as model directory: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpolFdbX
INFO:tensorflow:Using config: {'_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
  rewrite_options {
    meta_optimizer_iterations: ONE
  }
}
, '_keep_checkpoint_max': None, '_task_type': 'worker', '_train_distribute': None, '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x14141c990>, '_model_dir': '/var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpolFdbX', '_protocol': None, '_save_checkpoints_steps': 300, '_keep_checkpoint_every_n_hours': 1, '_service': None, '_num_ps_replicas': 0, '_tpu_config': TPUConfig(iterations_per_loop=300, num_shards=None, num_cores_per_replica=None, per_host_input_for_training=2, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_tf_random_seed': None, '_save_summary_steps': 300, '_device_fn': None, '_session_creation_timeout_secs': 7200, '_cluster': None, '_experimental_distribute': None, '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': None, '_experimental_max_worker_delay_secs': None, '_evaluation_master': '', '_eval_distribute': None, '_global_id_in_cluster': 0, '_master': ''}
I1123 20:41:28.003739 4733580736 estimator.py:212] Using config: {'_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
  rewrite_options {
    meta_optimizer_iterations: ONE
  }
}
, '_keep_checkpoint_max': None, '_task_type': 'worker', '_train_distribute': None, '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x14141c990>, '_model_dir': '/var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpolFdbX', '_protocol': None, '_save_checkpoints_steps': 300, '_keep_checkpoint_every_n_hours': 1, '_service': None, '_num_ps_replicas': 0, '_tpu_config': TPUConfig(iterations_per_loop=300, num_shards=None, num_cores_per_replica=None, per_host_input_for_training=2, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_tf_random_seed': None, '_save_summary_steps': 300, '_device_fn': None, '_session_creation_timeout_secs': 7200, '_cluster': None, '_experimental_distribute': None, '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': None, '_experimental_max_worker_delay_secs': None, '_evaluation_master': '', '_eval_distribute': None, '_global_id_in_cluster': 0, '_master': ''}
INFO:tensorflow:_TPUContext: eval_on_tpu False
I1123 20:41:28.022785 4733580736 tpu_context.py:220] _TPUContext: eval_on_tpu False
WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:103: make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_initializable_iterator(dataset)`.
W1123 20:41:28.025648 4733580736 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:103: make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_initializable_iterator(dataset)`.
2019-11-23 20:41:28.055441: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-11-23 20:41:28.102833: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f9c4d6bd0b0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2019-11-23 20:41:28.102980: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
INFO:tensorflow:Starting transcription for /Users/klt/Desktop/tmp/p.wav...
I1123 20:41:28.128268 4733580736 onsets_frames_transcription_transcribe.py:113] Starting transcription for /Users/klt/Desktop/tmp/p.wav...
INFO:tensorflow:Processing file...
I1123 20:41:28.128619 4733580736 onsets_frames_transcription_transcribe.py:119] Processing file...
INFO:tensorflow:Running inference...
I1123 20:41:32.646573 4733580736 onsets_frames_transcription_transcribe.py:129] Running inference...
INFO:tensorflow:Could not find trained model in model_dir: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpolFdbX, running initialization to predict.
I1123 20:41:32.646955 4733580736 estimator.py:615] Could not find trained model in model_dir: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpolFdbX, running initialization to predict.
WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling __init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
W1123 20:41:32.658987 4733580736 deprecation.py:506] From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling __init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Bus error: 10
(venv) (base) MacBook-Pro:onsets_frames_transcription klt$ MODEL_DIR="train"
(venv) (base) MacBook-Pro:onsets_frames_transcription klt$ onsets_frames_transcription_transcribe --model_dir="${CHECKPOINT_DIR}" "/Users/klt/Desktop/tmp/p.wav"
/Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/librosa/__init__.py:35: FutureWarning: You are using librosa with Python 2. Please note that librosa 0.7 will be the last version to support Python 2, after which it will require Python 3 or later.
  FutureWarning)
WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py:12: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.

W1123 20:42:42.978538 4656154048 module_wrapper.py:139] From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py:12: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:136: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.

W1123 20:42:44.601079 4656154048 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:136: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:626: output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
W1123 20:42:49.091053 4656154048 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:626: output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
WARNING:tensorflow:Using temporary folder as model directory: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpLReVyx
W1123 20:42:49.123639 4656154048 estimator.py:1821] Using temporary folder as model directory: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpLReVyx
INFO:tensorflow:Using config: {'_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
  rewrite_options {
    meta_optimizer_iterations: ONE
  }
}
, '_keep_checkpoint_max': None, '_task_type': 'worker', '_train_distribute': None, '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x13b54bd90>, '_model_dir': '/var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpLReVyx', '_protocol': None, '_save_checkpoints_steps': 300, '_keep_checkpoint_every_n_hours': 1, '_service': None, '_num_ps_replicas': 0, '_tpu_config': TPUConfig(iterations_per_loop=300, num_shards=None, num_cores_per_replica=None, per_host_input_for_training=2, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_tf_random_seed': None, '_save_summary_steps': 300, '_device_fn': None, '_session_creation_timeout_secs': 7200, '_cluster': None, '_experimental_distribute': None, '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': None, '_experimental_max_worker_delay_secs': None, '_evaluation_master': '', '_eval_distribute': None, '_global_id_in_cluster': 0, '_master': ''}
I1123 20:42:49.126346 4656154048 estimator.py:212] Using config: {'_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
  rewrite_options {
    meta_optimizer_iterations: ONE
  }
}
, '_keep_checkpoint_max': None, '_task_type': 'worker', '_train_distribute': None, '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x13b54bd90>, '_model_dir': '/var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpLReVyx', '_protocol': None, '_save_checkpoints_steps': 300, '_keep_checkpoint_every_n_hours': 1, '_service': None, '_num_ps_replicas': 0, '_tpu_config': TPUConfig(iterations_per_loop=300, num_shards=None, num_cores_per_replica=None, per_host_input_for_training=2, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_tf_random_seed': None, '_save_summary_steps': 300, '_device_fn': None, '_session_creation_timeout_secs': 7200, '_cluster': None, '_experimental_distribute': None, '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': None, '_experimental_max_worker_delay_secs': None, '_evaluation_master': '', '_eval_distribute': None, '_global_id_in_cluster': 0, '_master': ''}
INFO:tensorflow:_TPUContext: eval_on_tpu False
I1123 20:42:49.128591 4656154048 tpu_context.py:220] _TPUContext: eval_on_tpu False
WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:103: make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_initializable_iterator(dataset)`.
W1123 20:42:49.129336 4656154048 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:103: make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_initializable_iterator(dataset)`.
2019-11-23 20:42:49.145057: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-11-23 20:42:49.196234: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fe191151f50 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2019-11-23 20:42:49.196301: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
INFO:tensorflow:Starting transcription for /Users/klt/Desktop/tmp/p.wav...
I1123 20:42:49.234787 4656154048 onsets_frames_transcription_transcribe.py:113] Starting transcription for /Users/klt/Desktop/tmp/p.wav...
INFO:tensorflow:Processing file...
I1123 20:42:49.238156 4656154048 onsets_frames_transcription_transcribe.py:119] Processing file...
INFO:tensorflow:Running inference...
I1123 20:42:51.931320 4656154048 onsets_frames_transcription_transcribe.py:129] Running inference...
INFO:tensorflow:Could not find trained model in model_dir: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpLReVyx, running initialization to predict.
I1123 20:42:51.931879 4656154048 estimator.py:615] Could not find trained model in model_dir: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpLReVyx, running initialization to predict.
WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling __init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
W1123 20:42:51.936925 4656154048 deprecation.py:506] From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling __init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Bus error: 10
(venv) (base) MacBook-Pro:onsets_frames_transcription klt$ onsets_frames_transcription_transcribe --model_dir="${CHECKPOINT_DIR}" /Users/klt/Desktop/tmp/p.wav
/Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/librosa/__init__.py:35: FutureWarning: You are using librosa with Python 2. Please note that librosa 0.7 will be the last version to support Python 2, after which it will require Python 3 or later.
  FutureWarning)
WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py:12: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.

W1123 20:43:46.547178 4500542912 module_wrapper.py:139] From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py:12: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:136: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.

W1123 20:43:48.238924 4500542912 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:136: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.

WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:626: output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
W1123 20:43:52.166743 4500542912 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/data.py:626: output_shapes (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.data.get_output_shapes(dataset)`.
WARNING:tensorflow:Using temporary folder as model directory: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpP9UtYs
W1123 20:43:52.207689 4500542912 estimator.py:1821] Using temporary folder as model directory: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpP9UtYs
INFO:tensorflow:Using config: {'_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
  rewrite_options {
    meta_optimizer_iterations: ONE
  }
}
, '_keep_checkpoint_max': None, '_task_type': 'worker', '_train_distribute': None, '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x135b4f650>, '_model_dir': '/var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpP9UtYs', '_protocol': None, '_save_checkpoints_steps': 300, '_keep_checkpoint_every_n_hours': 1, '_service': None, '_num_ps_replicas': 0, '_tpu_config': TPUConfig(iterations_per_loop=300, num_shards=None, num_cores_per_replica=None, per_host_input_for_training=2, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_tf_random_seed': None, '_save_summary_steps': 300, '_device_fn': None, '_session_creation_timeout_secs': 7200, '_cluster': None, '_experimental_distribute': None, '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': None, '_experimental_max_worker_delay_secs': None, '_evaluation_master': '', '_eval_distribute': None, '_global_id_in_cluster': 0, '_master': ''}
I1123 20:43:52.208148 4500542912 estimator.py:212] Using config: {'_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true
graph_options {
  rewrite_options {
    meta_optimizer_iterations: ONE
  }
}
, '_keep_checkpoint_max': None, '_task_type': 'worker', '_train_distribute': None, '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x135b4f650>, '_model_dir': '/var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpP9UtYs', '_protocol': None, '_save_checkpoints_steps': 300, '_keep_checkpoint_every_n_hours': 1, '_service': None, '_num_ps_replicas': 0, '_tpu_config': TPUConfig(iterations_per_loop=300, num_shards=None, num_cores_per_replica=None, per_host_input_for_training=2, tpu_job_name=None, initial_infeed_sleep_secs=None, input_partition_dims=None, eval_training_input_configuration=2, experimental_host_call_every_n_steps=1), '_tf_random_seed': None, '_save_summary_steps': 300, '_device_fn': None, '_session_creation_timeout_secs': 7200, '_cluster': None, '_experimental_distribute': None, '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': None, '_experimental_max_worker_delay_secs': None, '_evaluation_master': '', '_eval_distribute': None, '_global_id_in_cluster': 0, '_master': ''}
INFO:tensorflow:_TPUContext: eval_on_tpu False
I1123 20:43:52.209754 4500542912 tpu_context.py:220] _TPUContext: eval_on_tpu False
WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:103: make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_initializable_iterator(dataset)`.
W1123 20:43:52.210043 4500542912 deprecation.py:323] From /Users/klt/code/phd/magenta-master/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:103: make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_initializable_iterator(dataset)`.
2019-11-23 20:43:52.221619: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-11-23 20:43:52.251399: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fb7beeaf4c0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2019-11-23 20:43:52.251438: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
INFO:tensorflow:Starting transcription for /Users/klt/Desktop/tmp/p.wav...
I1123 20:43:52.303266 4500542912 onsets_frames_transcription_transcribe.py:113] Starting transcription for /Users/klt/Desktop/tmp/p.wav...
INFO:tensorflow:Processing file...
I1123 20:43:52.306233 4500542912 onsets_frames_transcription_transcribe.py:119] Processing file...
INFO:tensorflow:Running inference...
I1123 20:43:54.843364 4500542912 onsets_frames_transcription_transcribe.py:129] Running inference...
INFO:tensorflow:Could not find trained model in model_dir: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpP9UtYs, running initialization to predict.
I1123 20:43:54.843811 4500542912 estimator.py:615] Could not find trained model in model_dir: /var/folders/35/xkv0vz050bn4_qxdn4dclz700000gn/T/tmpP9UtYs, running initialization to predict.
WARNING:tensorflow:From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling __init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
W1123 20:43:54.848026 4500542912 deprecation.py:506] From /Users/klt/code/phd/magenta-master/venv/lib/python2.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling __init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Bus error: 10

As far as I can tell the problem happens at

prediction_list = list(
            estimator.predict(
                input_fn,
                checkpoint_path=checkpoint_path,
                yield_single_examples=False))
cghawthorne commented 4 years ago

The Bus error problem means that the error is probably coming from within Tensorflow. I'd guess the most likely cause is either your CPU doesn't support some instruction set that Tensorflow was compiled with or there's an error with how your GPU drivers are installed.

mldubey commented 4 years ago

I am currently encountering this same error. I setup magenta with a conda env, and am able to run other programs such as melody_rnn just fine. I am only getting this same Bus Error 10 when I try to run Onsets and Frames. Have you figured out why this happens?

maulic32768 commented 4 years ago

I haven't unfortunately, not on the macbook. It does work on my PC (running Arch Linux) with the same installation/usage steps

mldubey commented 4 years ago

Here is my error message:

Fatal Python error: Bus error

Current thread 0x000070000fe2f000 (most recent call first): File "<__array_function__ internals>", line 6 in dot File "/anaconda2/envs/magenta/lib/python3.7/site-packages/librosa/feature/spectral.py", line 1836 in melspectrogram File "/Users/MLD/Desktop/Programming/MachineLearning/magenta/magenta/models/onsets_frames_transcription/data.py", line 88 in _wav_to_mel File "/Users/MLD/Desktop/Programming/MachineLearning/magenta/magenta/models/onsets_frames_transcription/data.py", line 121 in wav_to_spec File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/ops/script_ops.py", line 235 in call

Thread 0x0000000106fa65c0 (most recent call first): File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1443 in _call_tf_sessionrun File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1350 in _run_fn File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1365 in _do_call File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1359 in _do_run File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1180 in _run File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 956 in run File "/Users/MLD/Desktop/Programming/MachineLearning/magenta/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 126 in transcription_data File "/Users/MLD/Desktop/Programming/MachineLearning/magenta/magenta/models/onsets_frames_transcription/infer_util.py", line 150 in wrapper File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/tpu/tpu_estimator.py", line 2987 in _call_input_fn File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 996 in _get_features_from_input_fn File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 620 in predict File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/tpu/tpu_estimator.py", line 3072 in predict File "/Users/MLD/Desktop/Programming/MachineLearning/magenta/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 137 in run File "/Users/MLD/Desktop/Programming/MachineLearning/magenta/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 150 in main File "/anaconda2/envs/magenta/lib/python3.7/site-packages/absl/app.py", line 250 in _run_main File "/anaconda2/envs/magenta/lib/python3.7/site-packages/absl/app.py", line 299 in run File "/anaconda2/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/platform/app.py", line 40 in run File "/Users/MLD/Desktop/Programming/MachineLearning/magenta/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 154 in console_entry_point File "/anaconda2/envs/magenta/bin/onsets_frames_transcription_transcribe", line 11 in Bus error: 10

mldubey commented 4 years ago

It looks like the error is happening after "INFO:tensorflow:Running inference..."

So I think it has to do with tensorflow. Do you know if this code requires a GPU to run?

maulic32768 commented 4 years ago

No idea, sorry. My PC does have a GPU and my laptop doesn't though...

mldubey commented 4 years ago

I am now running on my Mac, but with Linux Ubuntu 18.04 installed through Parallels.

tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

No OpKernel was registered to support Op 'CudnnRNNCanonicalToParams' used by node onsets/cudnn_lstm/cudnn_lstm/CudnnRNNCanonicalToParams (defined at /miniconda3/envs/magenta/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1748) with these attrs: [seed=0, dropout=0, num_params=16, T=DT_FLOAT, input_mode="linear_input", direction="bidirectional", rnn_mode="lstm", seed2=0] Registered devices: [CPU, XLA_CPU] Registered kernels: device='GPU'; T in [DT_DOUBLE] device='GPU'; T in [DT_FLOAT] device='GPU'; T in [DT_HALF]

Do you know if I need tensorflow-gpu installed to run this code?

cghawthorne commented 4 years ago

If you want it to just use the CPU, you'll need to pass the option --hparams=use_cudnn=false.

mldubey commented 4 years ago

Thank you! That fixed it.

eupston commented 4 years ago

I'm getting Bus 10 error as well and when I try to add the hparam above I run into: ValueError: Unknown hyperparameter type for use_cudnn

my arguments are: python onsets_frames_transcription_transcribe.py --model_dir=e-gmd_checkpoint/ --config="drums" --hparams=use_cudnn=false danny_test.wav

tensorflow version is: 1.15.2

any ideas?

cghawthorne commented 4 years ago

Sorry for the confusion, the use_cudnn hparam does not apply to the drum model. It was written to be trained on TPUs, so it doesn't have any cudnn-specific code.

The bus error indicates that TensorFlow is trying to use instructions your CPU doesn't support. You'll need to either use a different computer or compile TensorFlow specifically for your machine.