Hello World

36 views
Skip to first unread message

Chris Los

unread,
Nov 5, 2021, 5:36:24 AM11/5/21
to Magenta Discuss
Hey Everyone,
It's been a while since I've been here in the discussion group. I hope you're all doing well and that you're still as excited about a.i. than I am? :-)

I'm currently preparing a class and it seems I can't get the magenta midi interface (call / response) properly working.

I created a mag bundle based on a  performance_with_dynamics_compact model.

After I  send a few notes via interal midi port to the magenta network it response with the follwing error:


Loaded 'performance_with_dynamics' generator bundle from file './model/beethoven_performance_rnn.mag'.


Instructions:

Start playing  when you want to begin the call phrase.

When you want to end the call phrase, signal control number 2 with value 127, or stop playing and wait one clock tick.

Once the response completes, the interface will wait for you to begin playing again to start a new call phrase.


To end the interaction, press CTRL-C.

Exception in thread Thread-1:

Traceback (most recent call last):

  File "/opt/anaconda3/envs/quad3/lib/python3.8/threading.py", line 932, in _bootstrap_inner

    self.run()

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/interfaces/midi/midi_interaction.py", line 455, in run

    response_sequence = self._generate(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/interfaces/midi/midi_interaction.py", line 344, in _generate

    response_sequence = self._sequence_generator.generate(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/models/shared/sequence_generator.py", line 194, in generate

    return self._generate(input_sequence, generator_options)

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/models/performance_rnn/performance_sequence_generator.py", line 241, in _generate

    performance = self._model.generate_performance(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/models/performance_rnn/performance_model.py", line 77, in generate_performance

    return self._generate_events(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/models/shared/events_rnn_model.py", line 371, in _generate_events

    events, _, loglik = beam_search(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/common/beam_search.py", line 129, in beam_search

    beam_entries = _generate_branches(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/common/beam_search.py", line 62, in _generate_branches

    all_sequences, all_states, all_scores = generate_step_fn(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/models/shared/events_rnn_model.py", line 228, in _generate_step

    batch_final_state, batch_loglik = self._generate_step_for_batch(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/magenta/models/shared/events_rnn_model.py", line 126, in _generate_step_for_batch

    final_state, softmax = self._session.run(

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 967, in run

    result = self._run(None, fetches, feed_dict, options_ptr,

  File "/opt/anaconda3/envs/quad3/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1164, in _run

    raise ValueError(

ValueError: Cannot feed value of shape (1, 90, 388) for Tensor 'Placeholder:0', which has shape '(1, ?, 1)'



Has anybody an idea how I might solve this issue?

Thanks in advance,

Chriistian



Chris Los

unread,
Nov 5, 2021, 5:54:03 AM11/5/21
to Magenta Discuss, Chris Los
EDIT:

the same shape error appears when I try to generate a sequence out of the mag:

!performance_rnn_generate \
--run_dir=/content/drive/MyDrive/Performance_RNN/training \
--hparams="rnn_layer_sizes=[512,512,512]" \
--bundle_file=/content/drive/MyDrive/Performance_RNN/training/model.mag \
--config='performance_with_dynamics_compact' \
--save_generator_bundle



!performance_rnn_generate \
--config='performance_with_dynamics_compact' \
--bundle_file=/content/drive/MyDrive/Performance_RNN/training/model.mag \
--output_dir=/content/drive/MyDrive/Performance_RNN/generate \
--num_outputs=10 \
--num_steps=2000 \
--primer_melody="[48,53,55,60,65,72,37]"


/usr/local/lib/python3.7/dist-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 /usr/local/lib/python3.7/dist-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 WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow/python/compat/v2_compat.py:101: 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 2021-11-05 09:50:50.308455: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:50.317986: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:50.318911: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:50.441747: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:50.442754: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:50.443630: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:51.047384: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:51.048405: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:51.049599: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-11-05 09:50:51.050668: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0. 2021-11-05 09:50:51.050776: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1510] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 15435 MB memory: -> device: 0, name: Tesla P100-PCIE-16GB, pci bus id: 0000:00:04.0, compute capability: 6.0 INFO:tensorflow:Restoring parameters from /tmp/tmp1jahwqt2/model.ckpt I1105 09:50:51.132233 140705505126272 saver.py:1298] Restoring parameters from /tmp/tmp1jahwqt2/model.ckpt INFO:tensorflow:Need to generate 1912 more steps for this sequence, will try asking for 1148 RNN steps I1105 09:50:51.208986 140705505126272 performance_sequence_generator.py:240] Need to generate 1912 more steps for this sequence, will try asking for 1148 RNN steps Traceback (most recent call last): File "/usr/local/bin/performance_rnn_generate", line 8, in <module> sys.exit(console_entry_point()) File "/usr/local/lib/python3.7/dist-packages/magenta/models/performance_rnn/performance_rnn_generate.py", line 290, in console_entry_point tf.app.run(main) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 303, in run _run_main(main, args) File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "/usr/local/lib/python3.7/dist-packages/magenta/models/performance_rnn/performance_rnn_generate.py", line 285, in main run_with_flags(generator) File "/usr/local/lib/python3.7/dist-packages/magenta/models/performance_rnn/performance_rnn_generate.py", line 244, in run_with_flags generated_sequence = generator.generate(primer_sequence, generator_options) File "/usr/local/lib/python3.7/dist-packages/magenta/models/shared/sequence_generator.py", line 194, in generate return self._generate(input_sequence, generator_options) File "/usr/local/lib/python3.7/dist-packages/magenta/models/performance_rnn/performance_sequence_generator.py", line 242, in _generate len(performance) + rnn_steps_to_gen, performance, **args) File "/usr/local/lib/python3.7/dist-packages/magenta/models/performance_rnn/performance_model.py", line 81, in generate_performance extend_control_events_callback=extend_control_events_callback) File "/usr/local/lib/python3.7/dist-packages/magenta/models/shared/events_rnn_model.py", line 378, in _generate_events steps_per_iteration=steps_per_iteration) File "/usr/local/lib/python3.7/dist-packages/magenta/common/beam_search.py", line 130, in beam_search beam_entries, generate_step_fn, branch_factor, first_iteration_num_steps) File "/usr/local/lib/python3.7/dist-packages/magenta/common/beam_search.py", line 63, in _generate_branches all_sequences, all_states, all_scores) File "/usr/local/lib/python3.7/dist-packages/magenta/models/shared/events_rnn_model.py", line 232, in _generate_step temperature) File "/usr/local/lib/python3.7/dist-packages/magenta/models/shared/events_rnn_model.py", line 127, in _generate_step_for_batch [graph_final_state, graph_softmax], feed_dict) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py", line 968, in run run_metadata_ptr) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py", line 1167, in _run (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (1, 22, 388) for Tensor 'Placeholder:0', which has shape '(1, ?, 1)'

Reply all
Reply to author
Forward
0 new messages