You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk\api.py in call_predict(self, classifiers, timezone)
321 gt_overall={}
322 for name,clf in classifiers:
--> 323 gt_overall,pred_overall[name]=self.predict(clf,self.test_mains,self.test_submeters, self.sample_period, timezone)
324
325 self.gt_overall=gt_overall
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk\api.py in predict(self, clf, test_elec, test_submeters, sample_period, timezone)
369
370
--> 371 pred_list = clf.disaggregate_chunk(test_elec)
372
373 # It might not have time stamps sometimes due to neural nets
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk_contrib\disaggregate\afhmm_sac.py in disaggregate_chunk(self, test_mains_list)
297
298 for i in range(len(threads)):
--> 299 self.arr_of_results.append(d[i])
300 prediction = pd.concat(self.arr_of_results,axis=0)
301 predictions_lst.append(prediction)
Hi, I have been trying to run AFHMM and AFHMM_SAC on the AMPds, however I keep getting a KeyError: 0
I'm not sure what I'm doing wrong, other algorithms in the library are working just fine (Seq2Seq, Seq2Point, and WindowGRU)
I would appreciate some help, Thank you!
experiment3 = {
'power': {'mains': ['active'],'appliance': ['active']},
'sample_rate': 60,
'appliances': ['light'],
'methods': { 'AFHMM_SAC': AFHMM_SAC({}), 'AFHMM': AFHMM({})
},
'train': {
'datasets': {
'AMPds': {
'path':r'c:\Users\cecil\OneDrive\Documents\REU Project\ampds.h5',
'buildings': {
1: {
'start_time': '2012-04-01',
'end_time': '2012-04-15'
}
}
}
}
},
'test': {
'datasets': {
'AMPds': {
'path': r'c:\Users\cecil\OneDrive\Documents\REU Project\ampds.h5',
'buildings': {
1: {
'start_time': '2012-04-15',
'end_time': '2012-04-17'
}
}
}
},
'metrics':['rmse',]
}
}
api_results_experiment_3 = API(experiment3)
Current Output:
Joint Testing for all algorithms
Loading data for AMPds dataset
Dropping missing values
Generating predictions for : AFHMM_SAC
KeyError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_1116\3430202567.py in
----> 1 api_results_experiment_3 = API(experiment3)
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk\api.py in init(self, params)
44 self.DROP_ALL_NANS = params.get("DROP_ALL_NANS", True)
45 self.site_only = params.get('site_only',False)
---> 46 self.experiment()
47
48
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk\api.py in experiment(self)
103 else:
104 print ("Joint Testing for all algorithms")
--> 105 self.test_jointly(d)
106
107 def train_chunk_wise(self, clf, d, current_epoch):
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk\api.py in test_jointly(self, d)
272 self.test_mains = [test_mains]
273 self.storing_key = str(dataset) + "_" + str(building)
--> 274 self.call_predict(self.classifiers, test.metadata["timezone"])
275
276
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk\api.py in call_predict(self, classifiers, timezone)
321 gt_overall={}
322 for name,clf in classifiers:
--> 323 gt_overall,pred_overall[name]=self.predict(clf,self.test_mains,self.test_submeters, self.sample_period, timezone)
324
325 self.gt_overall=gt_overall
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk\api.py in predict(self, clf, test_elec, test_submeters, sample_period, timezone)
369
370
--> 371 pred_list = clf.disaggregate_chunk(test_elec)
372
373 # It might not have time stamps sometimes due to neural nets
~\anaconda3\envs\nilmtk-env\lib\site-packages\nilmtk_contrib\disaggregate\afhmm_sac.py in disaggregate_chunk(self, test_mains_list)
297
298 for i in range(len(threads)):
--> 299 self.arr_of_results.append(d[i])
300 prediction = pd.concat(self.arr_of_results,axis=0)
301 predictions_lst.append(prediction)
in getitem(self, *args, **kwds)
~\anaconda3\envs\nilmtk-env\lib\multiprocessing\managers.py in _callmethod(self, methodname, args, kwds)
832 dispatch(conn, None, 'decref', (token.id,))
833 return proxy
--> 834 raise convert_to_error(kind, result)
835
836 def _getvalue(self):
KeyError: 0
The text was updated successfully, but these errors were encountered: