Skip to content

Transfer Learning Training using Washing Machine:Layer weight shape (10, 1, 1, 30) not compatible with provided weight shape (8, 1, 30, 30) #9

Description

@up1047045

Greetings dr Zhong

I am currently trying to use the following command (That's the one you provided in the README file, but i've changed the directories to my computer's path) :

python seq2point_train.py --appliance_name 'kettle' --datadir './dataset_management/refit/' --save_dir './trained_model' --transfer_cnn True --cnn washingmachine --pretrainedmodel_dir './pretrained_model' --crop_dataset 10000`

I have tested the original seq2point NILM algorithm and i get great results for all appliances, pretty much like the ones in your paper. But when i am trying the transfer learning part, i get the following error:

Traceback (most recent call last):
File "CODING\transferNILM_master\seq2point_train.py", line 221, in
pretrainedmodel_dir=args.pretrainedmodel_dir)
File "D:\Georgoulakis Titos\Smart_grid_Thesis\CODING\transferNILM_master\cnnModel.py", line 93, in get_model
cnn_weights_loader(model, cnn, pretrainedmodel_dir)
File "D:\Georgoulakis Titos\Smart_grid_Thesis\CODING\transferNILM_master\cnnModel.py", line 147, in cnn_weights_loader
model_to_fill.layers[int(name[-1])+1].set_weights(weight_values)
File "C:\Users\titos\anaconda3\envs\thesis\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 1305, in set_weights
'shape %s' % (ref_shape, weight.shape))
ValueError: Layer weight shape (10, 1, 1, 30) not compatible with provided weight shape (8, 1, 30, 30)

I really do not know what's wrong because i didn't make any changes in the original code you provided and i cannot understand why wouldn't it work.

I would really appreciate your thoughts for my problem. Thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions