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

run binary error #28

Open tonycui0401 opened 7 years ago

tonycui0401 commented 7 years ago

Hi when I run binary, I have got the following error:

Reading model from ./dumped.nnet Layers 221 Layer 0 InputLayer Layer is empty, maybe it is not defined? Cannot define network. Segmentation fault (core dumped)

could you please let me know what is the problem.

pplonski commented 7 years ago

Hi! Maybe there was some problem during network dump. Please check the dumped file if it looks ok. Which version of keras are you using?

tonycui0401 commented 7 years ago

Hi, I think it's heras 2, can I send you my network dump file to check and my hdf5 and model.json file, do you have an email address? Also if I run binary file successfully, how can I do a prediction in C++, I want to read a input image file and predict it in C++

pplonski commented 7 years ago

there are problems with keras 2. Please try to train your network in keras 1.2.2 and it should work.

tonycui0401 commented 7 years ago

hi I installed keras 1.2.2, but still the same error, also after this error? How can I write a predict function to predict images based on my model in c++