-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neural Network: Save/Load should preserve intermediate values #53
Comments
Are you optimizing your network structure? |
Hello! Since talking, I have added Convolution, Maxpooling (cpu and gpu) with optimized versions for convolution. LSTM is not optimized yet (though it already runs at reasonable speed, I believe it can be even faster). I have been adding a large amount of error checking and static_asserts which should make using the library easier (as it should more often give easy to understand errors). The save/load differences are limited to the LSTM, but I can try to fix them soon. (It currently works as expected for non LSTMs) I can try to solve the save/load issues soon as they shouldn't be too hard to fix. |
Then i hope solved this issues。 |
How about this issues? |
I'm working on changing the LSTM to an optimzied version so I'm holding off on fixing this issue till than. (Hopefully will be done by end of this weekend). |
thank you very much!
在 2019-12-12 06:34:00,"Joseph Jaspers" <[email protected]> 写道:
I'm working on changing the LSTM to an optimzied version so I'm holding off on fixing this issue till than. (Hopefully will be done by end of this weekend).
I am also trying to change the interface of Layers to make the easier to use. (It will look more like keras)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
when i save the trained model parameters, my screen black and flicker,how to avoid it? |
Are you using the GPU implementation? It most likely means that you are close to running out of (gpu) ram, if this happens with the CPU that is very strange, and I am not sure if this code could even cause such an issue. (Thought maybe a ram issue as well) |
Branch for the optimized LSTM Oddly enough it is faster in CPU mode but slower on the GPU (due to strided memory access). I might need to still work on it as I would prefer not to have different versions for each architecture |
I just added a change to save/load (really the "to_string" implementation) that avoids a gpu-allocation when the memory is continuous. This doesn't effect the CPU version at all. Additionally I have just added "clear_recycler" Which will clear all currently unused memory in the This may help if you are close to running out of ram, however I would try if the latest code fixes your problem before trying this. |
Load/saving in LSTM has been fixed: Caused by a bug with an incorrectly named method |
You can test that saving/loading works by replacing the mnist_test_recurrent/mnist_test.h with:
|
No, i am so sorry, it seems that the console popup, and output something. |
I only run it CPU,because using the GPU, the time is nearly equal to the cpu. |
OK. Thank you very much, let me have a try! |
Did not to need network.copy_training_data_to_single_predict(0)?? |
Neural Network: Load problem. |
When i save the model, how to forbid the console popup to print something? Because i did not the console project, but when i save the model, the console popup and screen flicker. |
In my project, when i load the trained model, then to single_predict, the first time the output is worse, the sencord, the third, the fourth and fifth, the output got better and better, and eventually stabilized。 |
-- Could you show me the outputs you receiving? I can't seem to emulate the problem. (Are you using copy_training_data_to_single_predict?) |
Also is this still an issue? Sorry I have not been able to test on Windows yet. |
(Not related to this issue) the directories should be included as such:
I did this to be more consistent with most C++ style guides |
|
My net struct: my code:
the single_predict result: i use the laod data to single_predict, use the same input, test three times, the first, second and the third time, the output is different. the result got better and better, the third time output close to the not load net single_predict. |
Looking into it now |
Hmm. I was able to compile without issues. |
Yes, not your code, but old version code no problem, error: |
When I run this: So I am not sure why your results aren't the same.
|
No, i aslo use the your mnist_text_recurrent example, the same isssue: |
Could you send me what process_predict_data is doing? |
this is process_predict_data function: template
} my whole example file: |
After
you should call
Here:
} I am using regular (batched) predict, so I do not need to copy the data over. |
No, there are something wrong with it, it was still a bug. I add the lstmpredicttask->m_pnetwork.copy_training_data_to_single_predict(0) after load, but in my project, after load, the same input, output three times still different.
result: |
I am so sorry.After i load the net , then add the lstmpredicttask->m_pnetwork.copy_training_data_to_single_predict(0), to single_predict, the result is so closely to the no-load single_predict, so this is not still a bug. But when i use the new code, so many compile error, it still the bug, it seems confilict whit the system string, somewheres. And when i save the net, console still pop to print somethings. |
when i to single_predict time by time, i think same input, and same output, it should only be use the trained parameters and not to update and change the parameters. I fell it still a bug, it it close to the no-load output, but time by time, the output is different. |
Glad to hear it works. I will try fix the console pop up bug. The new code compiles on Windows for me so I will have to look into that more. |
You have the blackcat\string.h file, and the struct name is same as the MVS's string file and class name: struct string: so i think they are confict. so when i rename the blackcat\string.h to blackcat\bcstring.h, and rename the struct string in blackcat\string.h to struct bcstring. and change the string name to bcstring in the io.h and filesystem.h file, it works. |
My string class is in the bc namespace so it should not have any issues. Are you directly including the blackcat directory? As that could cause a an inclusion issue with the std:: library. Try to include the folder containing blackcat opposed to including the blackcat folder directly. Correct: Incorrect: |
thank you very much. when i use #include "blackcat/tensors.h", it works. |
Awesome, glad it worked! |
What's next plan? attention-lstm, gpu optimize? |
I want to write a few tests and examples first, |
Currently when when saving a model only the weights are preserved, however the state should be preserved as well.
The text was updated successfully, but these errors were encountered: