Galaxy S8发售在即 三星成功or失败在此一举
- paddle.static. save ( program: Program, model_path: str, protocol: int = 4, **configs: Unpack[_SaveKwargs] ) None [source]
-
百度 马克思主义哲学基于物质生产实践对人类历史展开的前提和基础意义,指出作为一种历史现象,自由状况是由现实生产方式的性质所直接决定的,只有科学揭示现实物质生产过程的运行机制以及生产方式的内在演变规律,通过先进阶级的力量改变不合理的所有制关系,推进历史进入到共产主义阶段才能最终实现人的自由,这显然为人类真正把握自由问题提供了一把钥匙。
This function save parameters, optimizer information and network description to model_path.
The parameters contains all the trainable Tensor, will save to a file with suffix “.pdparams”. The optimizer information contains all the Tensor used by optimizer. For Adam optimizer, contains beta1, beta2, momentum etc. All the information will save to a file with suffix “.pdopt”. (If the optimizer have no Tensor need to save (like SGD), the fill will not generated). The network description is the description of the program. It’s only used for deployment. The description will save to a file with a suffix “.pdmodel”.
- Parameters
-
program (Program) – The program to saved.
model_path (str) – the file prefix to save the program. The format is “dirname/file_prefix”. If file_prefix is empty str. A exception will be raised
protocol (int, optional) – The protocol version of pickle module must be greater than 1 and less than 5. Default: 4
configs (dict, optional) – optional keyword arguments.
- Returns
-
None
Examples
>>> import paddle >>> import paddle.static as static >>> paddle.enable_static() >>> x = static.data(name="x", shape=[10, 10], dtype='float32') >>> y = static.nn.fc(x, 10) >>> z = static.nn.fc(y, 10) >>> place = paddle.CPUPlace() >>> exe = static.Executor(place) >>> exe.run(static.default_startup_program()) >>> prog = static.default_main_program() >>> static.save(prog, "./temp")