Help required in feature extraction

247 views
Skip to first unread message

aakash budhiraja

unread,
Jul 4, 2013, 10:49:53 AM7/4/13
to millionso...@googlegroups.com
I am using the python wrapper for accessing the data. Using the iterator code provided in the tutorial, I have been able to access the single valued parameters. However, I tried the same code on the parameters present as arrays. 
Here is the code 
import os
import glob
import sys
sys.path.append("C:\MSD\MSongsDB-master\PythonSrc")
import hdf5_getters
f = open("C:\MSD\data\outsegmentsstart.txt","w")
sys.stdout = f
def get_segments(basedir,ext='.h5') :
    for root, dirs, files in os.walk(basedir):
        files = glob.glob(os.path.join(root,'*'+ext))
        for f in files:
            h5 = hdf5_getters.open_h5_file_read(f)
            print hdf5_getters.get_segments_start(h5) 
            h5.close()
  get_segments("C:\.." )

And I am getting the following error on the same
NoSuchNodeError                           Traceback (most recent call last)
<ipython-input-2-54d555847dce> in <module>()
----> 1 get_all_titles("C:\MSD\millionsongsubset_full.tar\millionsongsubset_full\MillionSongSubset")

<ipython-input-1-cd4fc9992a29> in get_all_titles(basedir, ext)
     11         for f in files:
     12             h5 = hdf5_getters.open_h5_file_read(f)
---> 13             print( hdf5_getters.get_segments_start(h5) )
     14             h5.close()
     15 

C:\MSD\MSongsDB-master\PythonSrc\hdf5_getters.pyc in get_segments_start(h5, songidx)
    291     if h5.root.analysis.songs.nrows == songidx + 1:
    292         return h5.root.analysis.segments_start[h5.root.analysis.songs.cols.idx_segments_start[songidx]:]
--> 293     return h5.root.analysis.segments_start[h5.root.analysis.songs.cols.idx_segments_start[songidx]:
    294                                            h5.root.analysis.songs.cols.idx_segments_start[songidx+1]]
    295 

F:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages\tables\group.pyc in __getattr__(self, name)
    811             self._g_add_children_names()
    812             return mydict[name]
--> 813         return self._f_get_child(name)
    814 
    815     def __setattr__(self, name, value):

F:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages\tables\group.pyc in _f_get_child(self, childname)
    681         self._g_check_open()
    682 
--> 683         self._g_check_has_child(childname)
    684 
    685         childPath = join_path(self._v_pathname, childname)

F:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages\tables\group.pyc in _g_check_has_child(self, name)
    405             raise NoSuchNodeError(
    406                 "group ``%s`` does not have a child named ``%s``"
--> 407                 % (self._v_pathname, name))
    408         return node_type
    409 

NoSuchNodeError: group ``/analysis`` does not have a child named ``segments_start``

Any suggestions on how to deal with this? 
Thank You!
--
Aakash Budhiraja
Junior Undergraduate
IIT Delhi
+91- 9990003686

Thierry Bertin-Mahieux

unread,
Jul 5, 2013, 12:17:46 PM7/5/13
to millionso...@googlegroups.com
Hi Aakash,
Does it append for every song, or is in an issue with one in particular?
One possibility is that the HDF5 library works differently on Windows, the code was developed on linux/mac, but that would surprise me.
Also, is it every array field? this particular, get_segment_start, returns 0 most of the time, it's just there in case you want to aggregate songs into 1 hdf5 file.

Sorry I can't be of more help, I've never seen that error before and don't know how to reproduce it.
Good luck!
Thierry


--
--
You received this message because you are subscribed to the Google
Groups "Million Song Dataset" group.
To post to this group, send email to millionso...@googlegroups.com
To unsubscribe from this group, send email to
millionsongdata...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/millionsongdataset?hl=en?hl=en
Million Song Dataset main webpage:
http://labrosa.ee.columbia.edu/millionsong/
 
---
You received this message because you are subscribed to the Google Groups "Million Song Dataset" group.
To unsubscribe from this group and stop receiving emails from it, send an email to millionsongdata...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thierry Bertin-Mahieux
http://www.tbertinmahieux.com
Reply all
Reply to author
Forward
0 new messages