torch / nngraph

Graph Computation for nn
Other
299 stars 96 forks source link

Got 'Expected nnop.Parameters node, module not found in node' error #134

Open sunshineatnoon opened 8 years ago

sunshineatnoon commented 8 years ago

I tried to turn a pre-trained VGG into a nngraph module and stuck some texture loss layers (used in neural style transfer) between some layers, but I kept got this error: Expected nnop.Parameters node, module not found in node It seems that if I don't stuck texture loss layers, then the graph model is fine, but even if I add one texture loss layer into the graph model, I got this error. Does anyone know how to solve this ? Thanks!

arthitag commented 7 years ago

Hi,

I got the same error too when I tried to modify a model. I am not sure what exactly went wrong in your case but in my case,

creating the original nngraph model - local model = nn.gModule({input}, output)

My modification needed some extra inputs to the model so I had to create the new nngraph model as local model = nn.gModule({input,newinput}, output).

In your case, if you have multiple (new) outputs make sure you add them to the output table.