Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ArunRanganarsimhaiah opened this issue Mar 22, 2023 · 0 comments

Comments

@ArunRanganarsimhaiah
Copy link

ArunRanganarsimhaiah commented Mar 22, 2023

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??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant