serizba / cppflow

Run TensorFlow models in C++ without installation and without Bazel
https://serizba.github.io/cppflow/
MIT License
771 stars 177 forks source link

Different results in Python and C #263

Open ajauhar-fw opened 3 weeks ago

ajauhar-fw commented 3 weeks ago

Hi, I have networks consisting of LSTM, Convolutional and Dense layers, and some BatchNormalization and Concatenate layers. There is also a lambda layer which performs a very simple function - picking one value out of N values in a layer. I am having an issue where the model results from the same data are different when I run the model in Python or in C++ with cppflow. The results are not horribly off, but they are different enough to degrade my model's performance a significant amount, since this si for prediction with high accuracy.

I cannot share details of the model since it's proprietary for my work, but I was hoping someone had run into a similar issue with these layers. Would appreciate any insight!

ajauhar-fw commented 2 weeks ago

I have new information: I replicated the problem with an LSTM network grabbed off Kaggle, and modified one of the cppflow examples to load the graph and data from Python. I've added both files in the zip here, hoping someone on this forum or the author can give it a shot delhi-mean-temperature-lstm_mod.zip