pplonski / keras2cpp

This is a bunch of code to port Keras neural network model into pure C++.
MIT License
679 stars 153 forks source link

ValueError: Dimension 1 in both shapes must be equal, but are 3 and 4 for 'Assign_564' (op: 'Assign') with input shapes: [2048,3], [2048,4]. #26

Closed tonycui0401 closed 7 years ago

tonycui0401 commented 7 years ago

Hi pplonski,

 I try to dump network to plain text file, I have pre generated model.json and hdf5 file, when I used your command I get the following errors:

ValueError: Dimension 1 in both shapes must be equal, but are 3 and 4 for 'Assign_564' (op: 'Assign') with input shapes: [2048,3], [2048,4].

Could you help me resolve this error, thank you

pplonski commented 7 years ago

Hi! It is hard to say, have you tried to run network dump with example network? What keras version are you using and which backend?

tonycui0401 commented 7 years ago

Hi, I tired, but I have my customed model, I need to be able to run it in c++, I can'r generate network dump using my customed model, How can I make a prediction function in c++ using my customised model?

pplonski commented 7 years ago

it is hard to say where is the problem, maybe it is problem with keras version or you are using layers that are not implemented in keras2cpp.