jdasam / online_amt

Real-time Automatic Piano Transcription using PyTorch with Web Visualization
68 stars 14 forks source link

Array error #1

Closed ghost closed 3 years ago

ghost commented 3 years ago

When I run_on_plt.py I get this error.

image

PS D:\online_amt-master> python run_on_plt.py
* recording
C:\Users\Ulises\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\_asarray.py:102: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must 
specify 'dtype=object' when creating the ndarray.
  return array(a, dtype, copy=False, order=order)
TypeError: only size-1 arrays can be converted to Python scalars

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run_on_plt.py", line 83, in <module>
    main(args.model_file)
  File "run_on_plt.py", line 75, in main
    draw_plot(q)
  File "run_on_plt.py", line 58, in draw_plot
    new_roll[:, -num_updated:] = np.asarray(updated_frames).T
ValueError: setting an array element with a sequence.

I would be more than grateful if you could help me =) Thanks in advance

jdasam commented 3 years ago

Hello, I've found that the error occurred when the transcriber goes to sleep mode after some silence. I didn't handle this sleep mode properly for run_on_plt.py. I've fixed the code and updated it on the repository.

Thank you for reporting the issue.