You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently models are loaded from a file using the model constructor which calls readGraph.
Sometimes it is helpful to load a model from resources. This is an issue that I have solved for frozen graphs, and I'm posting it here as a suggestion, in case you want to add it to the master.
(I'm not that familiar with GitHub, so excuse me not branching the master and pushing, or whatever the terms are!)
I added to model.h a new constructor which takes a pointer to a std::vector of uchar as its only parameter. This then provides the arguments bufferModel->data() and bufferModel->size() to TF_NewBufferFromString instead of readGraph(filename) as in the existing version.
I then load the PB model from resources as std::vector<uchar> using a LoadModel function in my own project's source code, and pass that to the new model constructor. My project happens to be using wxWidgets, and so this is conveniently done as follows. I include this here only in case this might help someone in future. It's not itself a suggestion for cppflow.
Many thanks for this extremely helpful library.
Currently models are loaded from a file using the
model
constructor which callsreadGraph
.Sometimes it is helpful to load a model from resources. This is an issue that I have solved for frozen graphs, and I'm posting it here as a suggestion, in case you want to add it to the master.
(I'm not that familiar with GitHub, so excuse me not branching the master and pushing, or whatever the terms are!)
I added to
model.h
a new constructor which takes a pointer to astd::vector
ofuchar
as its only parameter. This then provides the argumentsbufferModel->data()
andbufferModel->size()
toTF_NewBufferFromString
instead ofreadGraph(filename)
as in the existing version.I then load the PB model from resources as
std::vector<uchar>
using aLoadModel
function in my own project's source code, and pass that to the new model constructor. My project happens to be using wxWidgets, and so this is conveniently done as follows. I include this here only in case this might help someone in future. It's not itself a suggestion for cppflow.The text was updated successfully, but these errors were encountered: