Earworm Memory Error

33 views
Skip to first unread message

beri...@gmail.com

unread,
Dec 8, 2010, 10:44:45 AM12/8/10
to The Echo Nest Remix API
Hello, I'm new to python, so forgive me if this is just a stupid
mistake on my part. I googled what I could, and searched the echonest
as best as I could. After much head banging, I installed everything
needed to get earworm working. I know this because I was able to run
(from the readme file): $ python earworm.py ../music/BillieJean.mp3. I
even checked the temp folder and listened to the ~5 minute Billy Jean.
Then I tried making it do the 1200 second and the 30 second examples,
and both times yielded the exact same size song with the same ~5
minute duration. Here's what the command line had to say about it:

C:Python26echo-nest-remix-examplesearworm>python earworm.py -d 30 ../
music/Bi llieJean.mp3 Computed MD5 of file is
2d539b439ec027e73abd2390c5611d2f Probing for existing analysis en-
ffmpeg -i "../music/BillieJean.mp3" en-ffmpeg -y -i "../music/
BillieJean.mp3" -ac 2 -ar 44100 "c:userspcgent~1app
datalocaltemptmp_bkmlc.wav" Traceback (most recent call last): File
"earworm.py", line 567, in main() File "earworm.py", line 541, in main
actions = do_work(track, options) File "earworm.py", line 459, in
do_work t_paths = get_paths(timbre['matrix']) File "earworm.py", line
109, in get_paths mat = make_similarity_matrix(matrix, size=MIN_ALIGN)
File "earworm.py", line 105, in make_similarity_matrix distMat =
sqrt(np.sum((repmat(points, numPoints, 1) - repeat(points, numPoin ts,
axis=0))2, axis=1, dtype=np.float32)) MemoryError

Other possibly pertinent data: I'm running python 2.6.2 on a Win 7 x32-
bit, I'm on example 15 in the online book Learn Python The Hard Way,
and I like walks on the beach while sipping piña coladas (and
daiquiris).

Elliot Winkler

unread,
Apr 4, 2011, 4:53:10 PM4/4/11
to remi...@googlegroups.com
Sorry to dig up this thread, but I'm getting the same error. Here is the output I'm getting:

~~~
elliot@elliot-linux-vm:~/src/echo-nest-remix/examples/earworm$ python earworm.py /home/elliot/tmp/jack-conte-this-disaster.mp3
INFO:pyechonest.util:took 2.85s: (200)
Traceback (most recent call last):
  File "earworm.py", line 562, in <module>
    main()
  File "earworm.py", line 536, in main
    actions = do_work(track, options)
  File "earworm.py", line 459, in do_work
    t_paths = get_paths(timbre['matrix'])
  File "earworm.py", line 109, in get_paths
    mat = make_similarity_matrix(matrix, size=MIN_ALIGN)
  File "earworm.py", line 105, in make_similarity_matrix
    distMat = sqrt(np.sum((repmat(points, numPoints, 1) - repeat(points, numPoints, axis=0))**2, axis=1, dtype=np.float32))
  File "/usr/lib/python2.6/dist-packages/numpy/matlib.py", line 199, in repmat
    c = a.reshape(1,a.size).repeat(m, 0).reshape(rows, origcols).repeat(n,0)
MemoryError
~~~

I'm running Python 2.6.6 using the latest version of echonest and remix HEAD on Ubuntu Maverick.

Is there a reason why this error would be occurring? At least if I knew where to start I could get somewhere, but I have no idea what to do.

-- Elliot

TeeJay

unread,
Apr 4, 2011, 7:09:13 PM4/4/11
to The Echo Nest Remix API
Are you sure you're running the latest remix? It was released late
last week, and most of it was about fixing some of the known bugs.


On Apr 4, 4:53 pm, Elliot Winkler <elliot.wink...@gmail.com> wrote:
> Sorry to dig up this thread, but I'm getting the same error. Here is the
> output I'm getting:
>
> ~~~
> elliot@elliot-linux-vm:~/src/echo-nest-remix/examples/earworm$ python
> earworm.py /home/elliot/tmp/jack-conte-this-disaster.mp3
> INFO:pyechonest.util:http://developer.echonest.com/api/v4/track/profile?api_key=WDXWDASXM6...

Elliot Winkler

unread,
Apr 5, 2011, 2:05:51 AM4/5/11
to remi...@googlegroups.com
Yup, I checked out the remix source today, so I am on 1.4.

The MP3 file I'm using, I converted from an AAC file. So I thought maybe it was that -- like maybe I didn't do it right. Out of curiosity, I tried another MP3 file and got the same MemoryError. However, the example music (at least the song I tried) works just fine. Do I need to use less complex songs or something?

-- Elliot


--
You received this message because you are subscribed to the Google Groups "The Echo Nest Remix API" group.
To post to this group, send email to remi...@googlegroups.com.
To unsubscribe from this group, send email to remix-api+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/remix-api?hl=en.


Elliot Winkler

unread,
Apr 6, 2011, 7:50:29 AM4/6/11
to remi...@googlegroups.com
Okay, I looked into a bit further. I've been running this on a virtual machine and I'd only allocated half a gig of RAM. So NumPy (which is what was crashing, looking at the backtrace) was actually just reporting what it knew: that it had actually run out of memory :P After I bumped the VM up to 2 gigs, earworm worked successfully, though it happily gobbled up pretty much all of the memory (overflowing into swap, etc.). So... earworm is pretty neat, but it's kind of a hassle to use. I'd imagine there isn't that much optimization in place, though (hence, I guess, why it's in the examples/ folder).

-- Elliot

TeeJay

unread,
Apr 6, 2011, 9:40:18 AM4/6/11
to The Echo Nest Remix API
Ok good. That makes sense. Python is definitely not the lightest
environment around. And you're right that this example is not
particularly optimized for space. However, if you look at it, there's
a constant called MAX_SIZE = 800. If you made that number smaller, or
even 0, you'd turn on a slower process that is more efficient in terms
of memory used. That number represents a maximum square matrix size
allowed that is stored in memory: 800 x 800 x float32 is large.

Tristan

beri...@gmail.com

unread,
Apr 18, 2011, 9:49:17 AM4/18/11
to The Echo Nest Remix API
I was just about to talk about all the things I did to try to isolate
the problem further, but the MAX_SIZE thing seems to have fixed it for
me. My particular solution was to drop it to 600.
Reply all
Reply to author
Forward
0 new messages