Closed maulic32768 closed 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.
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?
I haven't unfortunately, not on the macbook. It does work on my PC (running Arch Linux) with the same installation/usage steps
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
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?
No idea, sorry. My PC does have a GPU and my laptop doesn't though...
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?
If you want it to just use the CPU, you'll need to pass the option --hparams=use_cudnn=false
.
Thank you! That fixed it.
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?
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.
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:
I get this output:
As far as I can tell the problem happens at