adbrebs / handwriting

Conditional handwriting generation in Theano
24 stars 9 forks source link

converting raw data to hdf5 #3

Open mrmartin opened 7 years ago

mrmartin commented 7 years ago

First of all, thank you for making this code available!

Am I right that the link https://github.com/szcom/rnnlib/blob/master/examples/online_prediction/training_set.txt should be? : https://raw.githubusercontent.com/szcom/rnnlib/master/examples/online_prediction/training_set.txt

More importantly, data_raw2hdf5.py gives the following error: Traceback (most recent call last):

  File "./data_raw2hdf5.py", line 87, in <module>
    res = read_file(file_path)
  File "./data_raw2hdf5.py", line 70, in read_file
    pts.append(diff)
AttributeError: Element instance has no attribute 'append'

Isn't there a problem with initializing pts = [] and then using for pts in trace.getElementsByTagName('Point'):

The following fixes the error:

        for pti in trace.getElementsByTagName('Point'):
            pt = np.array([pti.getAttribute('x').strip(),
                           pti.getAttribute('y').strip(), 0],
                          dtype='float32')