nilmtk / nilmtk

Non-Intrusive Load Monitoring Toolkit (nilmtk)
http://nilmtk.github.io
Apache License 2.0
828 stars 458 forks source link

Exporting a combinatorial optimization model leads to nonstopper error related to HDF5 #512

Closed jpcofr closed 7 years ago

jpcofr commented 8 years ago

When doing combinatorial optimization and then trying to export the model, a nonstopper error related to HDF5 appears:

Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group None',) in <object repr() failed> ignored

A minimal example is:

import nilmtk
from nilmtk.disaggregate import CombinatorialOptimisation
from nilmtk import TimeFrame, MeterGroup, HDFDataStore
from nilmtk.dataset import DataSet

data = DataSet('/path/to/h5_dataset/ukdale.h5')
elec = data.buildings[1].elec
co = CombinatorialOptimisation()
co.train(elec)
co.export_model('/path/to/file/model_backup')
nipunbatra commented 8 years ago

Do you get the same error with some other data set also?

jpcofr commented 8 years ago

Sorry, I had to modify the title to fit the actual bug: this happens after calling

co.export_model('/path/to/file/model_backup')

As per your request, @nipunbatra, I tried the same process using

nilmtk/data/random.h5

And got the same result. Btw... do the people working on nilmtk have an IRC or a gitchat room so we can cooperate swiftly on things not related directly to the bugs?

nipunbatra commented 7 years ago

@jpcofr : Sorry for the very late reply. Did you get past this bug? Else, I am happy to help.

nipunbatra commented 7 years ago

I can confirm this error on OSX.


import nilmtk
from nilmtk.disaggregate import CombinatorialOptimisation
from nilmtk import TimeFrame, MeterGroup, HDFDataStore
from nilmtk.dataset import DataSet
data = DataSet('/data/REDD/redd.h5')
elec = data.buildings[1].elec
co = CombinatorialOptimisation()
co.train(elec)
co.export_model('co_redd_1')
Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group None',) in  ignored
Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group None',) in  ignored
Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group None',) in  ignored
Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group None',) in  ignored
Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group None',) in  ignored
Exception tables.exceptions.HDF5ExtError: HDF5ExtError('Problems closing the Group None',) in  ignored
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-11-276a46b9f26f> in <module>()
----> 1 co.export_model('co_redd_1')

/Users/nipunbatra/git/nilmtk/nilmtk/disaggregate/combinatorial_optimisation.pyc in export_model(self, filename)
    274         for pair in exported_model.model:
    275             pair['training_metadata'].store = (
--> 276                 pair['training_metadata'].store.store.filename)
    277         pickle.dump(exported_model, open(filename, 'wb'))

AttributeError: 'MeterGroup' object has no attribute 'store'
jpcofr commented 7 years ago

@nipunbatra Uhh... I'm not currently working with the framework, sorry for the late response... For me it is ok if you close the bug.