Open sreekanth3333 opened 6 years ago
We don't know what get_songs
does, can you clarify?
import numpy as np import pandas as pd import msgpack import glob import tensorflow as tf from tensorflow.python.ops import control_flow_ops from tqdm import tqdm
###################################################
import midi_manipulation
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
def get_songs(path): files = glob.glob('{}/.mid'.format(path)) songs = [] for f in tqdm(files): try: song = np.array(midi_manipulation.midiToNoteStateMatrix(f)) if np.array(song).shape[0] > 50: songs.append(song) except Exception as e: raise e return songs
songs = get_songs('Pop_Music_Midi') # These songs have already been converted from midi to msgpack print("{} songs processed".format(len(songs))) ###################################################
This is the coding. I think read_midifile is missing from the code which I got from web. Is it so?
Are you sure you don't have other python files named "midi.py" within the directory of the script you are running (or in the PYTHONPATH)?
I suppose you are using this: https://github.com/llSourcell/Music_Generator_Demo (in these cases, it is preferrable to link to the project or the file within it, to better help people understand its structure, instead of making them search around the web). Also, as a side note, please use the code
formatting when writing code in issues and comments, the code you pasted is almost unreadable.
Traceback (most recent call last):
File "rbm_chords.py", line 36, in
i tried reinstalling all dependencies in both python2 and python3. This one did the trick
pip3 install git+https://github.com/vishnubob/python-midi@feature/python3
That link is no longer valid, but I was able to get rbm_chords.py working by installing the dependencies via pip2 and specifying #!/usr/bin/python
in rbm_chords.py (so python2.7, not 3 per the instructions)
when run rbm_chords.py files:
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' ImportError: numpy.core.multiarray failed to import
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "
i face this issue please help me . Running this Project [https://github.com/llSourcell/Music_Generator_Demo]
Traceback (most recent call last):
File "rbm_chords.py", line 36, in
@sreekanth3333 please help me how you get rid from this error. i already run the pip install git+https://github.com/vishnubob/python-midi@feature/python3 but got this error
I am having the same exact issue with the same Music_Generator_Demo project. Was able to follow #124 and install midi 0.2.3 through github but did not resolve the issue. Running python 3.6.
Traceback (most recent call last): File "rbm_chords.py", line 36, in
songs = get_songs('Pop_Music_Midi') # These songs have already been converted from midi to msgpack
File "rbm_chords.py", line 32, in get_songs
raise e
AttributeError: 'module' object has no attribute 'read_midifile'
I am getting the above error, please help