-
Notifications
You must be signed in to change notification settings - Fork 536
Add pb model save #976
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
Add pb model save #976
Conversation
return Func.DynamicInvoke(args); | ||
} | ||
} | ||
public class Maybe<TA, TB> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Oceania2018 Please help to review this class. It seems to have an ugly design.😂 What I want is a class that allows to be either of two types. The two type often do not inherit from common interface. Using object
is a solution but it does not have a strong constraint of type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just remove FunctionHolder
? use lambda
instead?
Are you using this because the number of input args is uncertainty?
If that's the case, is it possible to use Tensors
as the args container?
It will be looks like: internal Tensors FunctionHolder(Tensors args);
A better approach is we can try to update Tensors
class, change the List<Tensor>
to List<ITensorOrOperation>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case that the number of input args is uncertain is one of the reasons of designing Maybe
. The other is that sometimes a return value of a function may be one type or another. If I separate the function to two, the place which call the function has to deal with two return types. The more the nest of calls, the more extra work it needs.
Thank you for your advice and I've removed Functionholder
.
Till now the development of pb format model saving has been finished. However, it's still phased. The following features are not supported:
Besides, saving the model training by tf with self-defined model has not been verified. Currently it's recommended to use keras with the pb format model saving. Then, the following records are for developers of tf.net:
|
Hi @AsakusaRinne, thank you for the add of this essential feature. In my exemple I use a GlobalAveragePooling2D layer, I don't get any issues during the saving part but I threw an Exeception during the loading part. Did you mind if I add myself the missing feature in the binding (supposing that I just need to take others ArgsDef files as exemple) ? Or else could you add this feature to the project ? Thank you. One more question : Is a load of .onnx files supported or did I need to build/use a converter .pb to .onnx and vis versa ? |
I add one issue in my case. |
@AdrienDeverin Hi, thank you for reporting us this missing of feature. The model loading is now in rapid development and may be unstable. I'll fix your problem once I finish the feature I'm now working on.
The loading of onnx file is on our schedule but unfortunately is now currently supported, please convert the onnx file to pb first. :) |
@AsakusaRinne Hi, thank to you. Issue : When we load a model (from a folder with correct .pb file), learn, and save, we get an issue during the saving partAfter some research it seem that your save function have a little bug when save or load the _name attribut of Tf.Variable. Basically, you don't get the layer name/type but only is type. My assumption : After a load, it didn't cause a problem during the learning since you don't use it during it, but it cause a issue when saved a second time as graph variable because you get multiple time the same name when you have more than one layer ("bias/" and "kernel/"). This bug could be temporally corrected by changed the function map_resources() in BaseResourceVariable.cs by something like this :
An other bug come from your way to use a Linq function. In _trackable_children() function of Functionnal you use Concat() and ToDictionnary() which cause a problem when we have multiple time the same element (occure due to the _unconditional_checkpoint_dependencies elements). If we change it by Union() it will resolve the problem.
Hope it will help you and others people who get this problem. |
And for the first issue with GlobalAveragePooling2D Layers, just adding a
|
@AsakusaRinne Thanks for your contribution. It looks good to merge.