nilmtk / nilmtk-contrib

Apache License 2.0
114 stars 59 forks source link

REDD dataset KeyError: 'No object named /building1/elec/meter1 in the file' #78

Open ArunRanganarsimhaiah opened 1 year ago

ArunRanganarsimhaiah commented 1 year ago

import warnings

warnings.filterwarnings("ignore") from nilmtk.api import API from nilmtk.disaggregate import Mean from nilmtk_contrib.disaggregate import DAE, Seq2Point, Seq2Seq, RNN, WindowGRU

redd = { 'power': { 'mains': ['apparent','active'], 'appliance': ['apparent','active'] }, 'sample_rate': 60,

'appliances': ['fridge'],
'methods': {

    #'WindowGRU': WindowGRU({'n_epochs': 2, 'batch_size': 32}),
    'RNN': RNN({'n_epochs': 50, 'batch_size': 32}),
    'DAE': DAE({'n_epochs': 50, 'batch_size': 32}),
    'Seq2Point': Seq2Point({'n_epochs': 50, 'batch_size': 32}),
    'Seq2Seq': Seq2Seq({'n_epochs': 50, 'batch_size': 32}),

    'Mean': Mean({}),

},
'train': {
    'datasets': {
        'REDD': {
            'path': './data/redd.h5',
            'buildings': {
                1: {
                    'start_time': '2011-04-18',
                    'end_time': '2011-04-30'
                },
                #                 56: {
                #             'start_time': '2015-01-28',
                #             'end_time': '2015-01-30'
                #           },
            }

        }
    }
},
'test': {
    'datasets': {
        'REDD': {
            'path': './data/redd.h5',
            'buildings': {
                1: {
                    'start_time': '2011-05-01',
                    'end_time': '2011-05-24'
                },
            }
        }
    },
    'metrics': ['mae']
}

} api_res = API(redd)

Using TensorFlow backend. Started training for RNN Joint training for RNN ............... Loading Data for training ................... Loading data for REDD dataset Loading building ... 1 Traceback (most recent call last): File "nilmtk-contrib.py", line 63, in api_res = API(redd) File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/api.py", line 46, in init self.experiment() File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/api.py", line 91, in experiment self.train_jointly(clf,d)
File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/api.py", line 212, in train_jointly train_df = next(train.buildings[building].elec.mains().load(physical_quantity='power', ac_type=self.power['mains'], sample_period=self.sample_period)) File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/metergroup.py", line 699, in load sections = kwargs.pop('sections', [self.get_timeframe()]) File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/metergroup.py", line 1387, in get_timeframe timeframe = meter.get_timeframe() File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/elecmeter.py", line 94, in get_timeframe return self.store.get_timeframe(key=self.key) File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/docinherit.py", line 53, in f return self.mthd(obj, *args, **kwargs) File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/nilmtk/datastore/hdfdatastore.py", line 222, in get_timeframe data_start_date = self.store.select(key, [0]).index[0] File "/home/gowda/anaconda3/envs/nilm-contrib/lib/python3.7/site-packages/pandas/io/pytables.py", line 757, in select raise KeyError("No object named {key} in the file".format(key=key)) KeyError: 'No object named /building1/elec/meter1 in the file' Closing remaining open files:./data/redd.h5...done/tmp/nilmtk-no6eom_n.h5...done

Could anyone help in fixing this issue??