onsets_frames_transcription_transcribe gives bus error:10

205 views
Skip to first unread message

Cynthia Wang

unread,
Sep 2, 2020, 6:17:03 PM9/2/20
to Magenta Discuss
Hello,

I'm trying to use onsets_frames_transcription_transcribe to transcribe my wav files to midi files. I followed the documentation to create the magenta environment with Anaconda and used
 'MODEL_DIR=<path to directory containing checkpoint> onsets_frames_transcription_transcribe \ --model_dir="${CHECKPOINT_DIR}" \ <piano_recording1.wav, piano_recording2.wav, ...>' 
from documentation to transcribe the files. I got 'bus error:10' and it gives a long list that looks like this:

/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/librosa/util/decorators.py:9: NumbaDeprecationWarning: An import was requested from a module that has moved location.

Import requested from: 'numba.decorators', please update to use 'numba.core.decorators' or pin to Numba version 0.48.0. This alias will not be present in Numba version 0.50.0.

  from numba.decorators import jit as optional_jit

/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/librosa/util/decorators.py:9: NumbaDeprecationWarning: An import was requested from a module that has moved location.

Import of 'jit' requested from: 'numba.decorators', please update to use 'numba.core.decorators' or pin to Numba version 0.48.0. This alias will not be present in Numba version 0.50.0.

  from numba.decorators import jit as optional_jit

/bin/sh: sox: command not found

SoX could not be found!


    If you do not have SoX, proceed here:

     - - - http://sox.sourceforge.net/ - - -


    If you do (or think that you should) have SoX, double-check your

    path variables.

    

WARNING:tensorflow:From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.

Instructions for updating:

non-resource variables are not supported in the long term

WARNING:tensorflow:AutoGraph could not transform <function preprocess_example at 0x7f8bcc033560> and will run it as-is.

Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.

Cause: module 'gast' has no attribute 'Index'

To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

W0902 15:04:42.363174 4549017024 ag_logging.py:146] AutoGraph could not transform <function preprocess_example at 0x7f8bcc033560> and will run it as-is.

Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.

Cause: module 'gast' has no attribute 'Index'

To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

WARNING:tensorflow:From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/data.py:138: 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.

    

W0902 15:04:42.368195 4549017024 deprecation.py:323] From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/data.py:138: 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:AutoGraph could not transform <function input_tensors_to_model_input at 0x7f8bcc033ef0> and will run it as-is.

Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.

Cause: module 'gast' has no attribute 'Index'

To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

W0902 15:04:42.579658 4549017024 ag_logging.py:146] AutoGraph could not transform <function input_tensors_to_model_input at 0x7f8bcc033ef0> and will run it as-is.

Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.

Cause: module 'gast' has no attribute 'Index'

To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

WARNING:tensorflow:From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/data.py:656: DatasetV1.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)`.

W0902 15:04:42.717572 4549017024 deprecation.py:323] From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/data.py:656: DatasetV1.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:From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/train_util.py:87: The name tf.estimator.tpu.RunConfig is deprecated. Please use tf.compat.v1.estimator.tpu.RunConfig instead.


W0902 15:04:42.793072 4549017024 module_wrapper.py:138] From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/train_util.py:87: The name tf.estimator.tpu.RunConfig is deprecated. Please use tf.compat.v1.estimator.tpu.RunConfig instead.


WARNING:tensorflow:From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/train_util.py:88: The name tf.estimator.tpu.TPUConfig is deprecated. Please use tf.compat.v1.estimator.tpu.TPUConfig instead.


W0902 15:04:42.793251 4549017024 module_wrapper.py:138] From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/train_util.py:88: The name tf.estimator.tpu.TPUConfig is deprecated. Please use tf.compat.v1.estimator.tpu.TPUConfig instead.


WARNING:tensorflow:From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/train_util.py:99: The name tf.estimator.tpu.TPUEstimator is deprecated. Please use tf.compat.v1.estimator.tpu.TPUEstimator instead.


W0902 15:04:42.793916 4549017024 module_wrapper.py:138] From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/train_util.py:99: The name tf.estimator.tpu.TPUEstimator is deprecated. Please use tf.compat.v1.estimator.tpu.TPUEstimator instead.


INFO:tensorflow:Using config: {'_model_dir': '/Users/cynthiawang/Desktop/Cynthia/Metis/Project_5/train', '_tf_random_seed': None, '_save_summary_steps': 300, '_save_checkpoints_steps': 300, '_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true

graph_options {

  rewrite_options {

    meta_optimizer_iterations: ONE

  }

}

, '_keep_checkpoint_max': None, '_keep_checkpoint_every_n_hours': 1, '_log_step_count_steps': None, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_session_creation_timeout_secs': 7200, '_service': None, '_cluster_spec': ClusterSpec({}), '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1, '_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), '_cluster': None}

I0902 15:04:42.794490 4549017024 estimator.py:191] Using config: {'_model_dir': '/Users/cynthiawang/Desktop/Cynthia/Metis/Project_5/train', '_tf_random_seed': None, '_save_summary_steps': 300, '_save_checkpoints_steps': 300, '_save_checkpoints_secs': None, '_session_config': allow_soft_placement: true

graph_options {

  rewrite_options {

    meta_optimizer_iterations: ONE

  }

}

, '_keep_checkpoint_max': None, '_keep_checkpoint_every_n_hours': 1, '_log_step_count_steps': None, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_session_creation_timeout_secs': 7200, '_service': None, '_cluster_spec': ClusterSpec({}), '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1, '_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), '_cluster': None}

INFO:tensorflow:_TPUContext: eval_on_tpu False

I0902 15:04:42.795078 4549017024 tpu_context.py:217] _TPUContext: eval_on_tpu False

WARNING:tensorflow:From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:102: DatasetV1.make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.

Instructions for updating:

This is a deprecated API that should only be used in TF 1 graph mode and legacy TF 2 graph mode available through `tf.compat.v1`. In all other situations -- namely, eager mode and inside `tf.function` -- you can consume dataset elements using `for elem in dataset: ...` or by explicitly creating iterator via `iterator = iter(dataset)` and fetching its elements via `values = next(iterator)`. Furthermore, this API is not available in TF 2. During the transition from TF 1 to TF 2 you can use `tf.compat.v1.data.make_initializable_iterator(dataset)` to create a TF 1 graph mode style iterator for a dataset created through TF 2 APIs. Note that this should be a transient state of your code base as there are in general no guarantees about the interoperability of TF 1 and TF 2 code.

W0902 15:04:42.795180 4549017024 deprecation.py:323] From /Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py:102: DatasetV1.make_initializable_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.

Instructions for updating:

This is a deprecated API that should only be used in TF 1 graph mode and legacy TF 2 graph mode available through `tf.compat.v1`. In all other situations -- namely, eager mode and inside `tf.function` -- you can consume dataset elements using `for elem in dataset: ...` or by explicitly creating iterator via `iterator = iter(dataset)` and fetching its elements via `values = next(iterator)`. Furthermore, this API is not available in TF 2. During the transition from TF 1 to TF 2 you can use `tf.compat.v1.data.make_initializable_iterator(dataset)` to create a TF 1 graph mode style iterator for a dataset created through TF 2 APIs. Note that this should be a transient state of your code base as there are in general no guarantees about the interoperability of TF 1 and TF 2 code.

2020-09-02 15:04:42.799492: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  AVX2 FMA

To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

2020-09-02 15:04:42.812637: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f8bcc89cd10 initialized for platform Host (this does not guarantee that XLA will be used). Devices:

2020-09-02 15:04:42.812668: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version

INFO:tensorflow:Starting transcription for /Users/cynthiawang/Desktop/Cynthia/Metis/Project_5/music_wav/music0.wav...

I0902 15:04:42.828495 4549017024 onsets_frames_transcription_transcribe.py:112] Starting transcription for /Users/cynthiawang/Desktop/Cynthia/Metis/Project_5/music_wav/music0.wav...

INFO:tensorflow:Processing file...

I0902 15:04:42.828691 4549017024 onsets_frames_transcription_transcribe.py:118] Processing file...

INFO:tensorflow:Running inference...

I0902 15:04:47.801345 4549017024 onsets_frames_transcription_transcribe.py:129] Running inference...

Fatal Python error: Bus error


Current thread 0x000070000add5000 (most recent call first):

  File "<__array_function__ internals>", line 6 in dot

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/librosa/feature/spectral.py", line 1836 in melspectrogram

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/data.py", line 85 in _wav_to_mel

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/data.py", line 118 in wav_to_spec

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/autograph/impl/api.py", line 302 in wrapper

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/ops/script_ops.py", line 244 in __call__


Thread 0x000000010f247dc0 (most recent call first):

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1443 in _call_tf_sessionrun

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1350 in _run_fn

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1365 in _do_call

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1359 in _do_run

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1181 in _run

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 958 in run

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 126 in transcription_data

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/infer_util.py", line 150 in wrapper

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/tpu/tpu_estimator.py", line 3041 in _call_input_fn

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1007 in _get_features_from_input_fn

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 611 in predict

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/tpu/tpu_estimator.py", line 3126 in predict

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 137 in run

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 150 in main

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/absl/app.py", line 251 in _run_main

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/absl/app.py", line 300 in run

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 40 in run

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/lib/python3.7/site-packages/magenta/models/onsets_frames_transcription/onsets_frames_transcription_transcribe.py", line 155 in console_entry_point

  File "/Users/cynthiawang/opt/anaconda3/envs/magenta/bin/onsets_frames_transcription_transcribe", line 8 in <module>

Bus error: 10


Does anyone know what's going on? The tensorflow version is 2.3.0 if that matters.

Thank you everyone in advance!


Curtis "Fjord" Hawthorne

unread,
Sep 11, 2020, 7:15:08 PM9/11/20
to Cynthia Wang, Magenta Discuss
Hi Cynthia,

A bus error typically means that your tensorflow installation was compiled for cpu instructions your machine does not support. You'll need to either run the command on a different system or compile a version of tensorflow that is compatible with your machine.

-Fjord

--
Magenta project: magenta.tensorflow.org
To post to this group, send email to magenta...@tensorflow.org
To unsubscribe from this group, send email to magenta-discu...@tensorflow.org
---
To unsubscribe from this group and stop receiving emails from it, send an email to magenta-discu...@tensorflow.org.
Reply all
Reply to author
Forward
0 new messages