Closed rpolea closed 2 years ago
@hetvi0609 can you try to replicate this?
@rpolea can you provide the versions for Tensorflow, Keras, etc.?
@rpolea Hi! Can you try the code again by changing the following line in eg:- WindowGRU.py, rnn.py etc:-
model.fit(train_x,train_y,validation_data=(v_x,v_y),epochs=self.n_epochs,callbacks=[checkpoint],shuffle=True,batch_size=self.batch_size)
You need to add the validation data as a tuple rather than a list. I think this will solve your problem. I have implemented it again and was able to get the results.
redd = {
'power': {
'mains': ['apparent','active'],
'appliance': ['apparent','active']
},
'sample_rate': 60,
'appliances': ['fridge'],
'methods': {
'WindowGRU':WindowGRU({'n_epochs':50,'batch_size':32}),
'RNN':RNN({'n_epochs':50,'batch_size':32}),
},
'train': {
'datasets': {
'REDD': {
'path': '/home/hetvi.shastri/redd.h5',
'buildings': {
1: {
'start_time': '2011-04-18',
'end_time': '2011-04-28'
},
}
}
}
},
'test': {
'datasets': {
'REDD': {
'path': '/home/hetvi.shastri/redd.h5',
'buildings': {
1: {
'start_time': '2011-05-01',
'end_time': '2011-05-03'
},
}
}
},
'metrics':['mae']
}
}
Output
Joint Testing for all algorithms
Loading data for REDD dataset
Loading data for meter ElecMeterID(instance=2, building=1, dataset='REDD')
Done loading data all meters for this chunk.
Dropping missing values
Generating predictions for : WindowGRU
Generating predictions for : RNN
............ mae ..............
WindowGRU RNN
fridge 15.912712 16.804665
Hi @hetvi0609 ,
Thank you for getting back to me with a solution. I made the changes as you suggested and the model now runs however when the model finishes running I get another error.
`--------------------------------------------------------------------------- AttributeError Traceback (most recent call last)
@rpolea Please refer to the issue #56
Hi,
Sorry for the delay but wanted to say I've done as you've suggested and now all the workbooks are running. Thank you so much for you help!
Hi,
I've been trying out some of the neural nets from the API documentation and I get the same error no matter which dataset I am using or what example I use. Currently tearing my hair out!
I have converted the REDD dataset to HDF5 using the documentation and then tried to feed it into the API as below. I've also pasted the error below.
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':50,'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': '/home/rpolea/redd_test.h5', 'buildings': { 1: { 'start_time': '2011-04-18', 'end_time': '2011-04-28' }, }
}, 'metrics':['mae'] } }
Started training for WindowGRU Joint training for WindowGRU ............... Loading Data for training ................... Loading data for REDD dataset Loading building ... 1 Loading data for meter ElecMeterID(instance=2, building=1, dataset='REDD')
Done loading data all meters for this chunk. Dropping missing values Training processing First model training for fridge Epoch 1/50 358/358 [==============================] - ETA: 0s - loss: 0.0116
ValueError Traceback (most recent call last)