mirror of
https://github.com/PaddlePaddle/PaddleClas.git
synced 2025-06-03 21:55:06 +08:00
revert
the code may cause problem that loss change in training.
This commit is contained in:
parent
6886cf0d65
commit
20730fad07
@ -15,7 +15,6 @@
|
|||||||
import copy
|
import copy
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
import paddle
|
|
||||||
import paddle.nn as nn
|
import paddle.nn as nn
|
||||||
from paddle.jit import to_static
|
from paddle.jit import to_static
|
||||||
from paddle.static import InputSpec
|
from paddle.static import InputSpec
|
||||||
@ -46,14 +45,6 @@ def build_model(config, mode="train"):
|
|||||||
prune_model(config, arch)
|
prune_model(config, arch)
|
||||||
quantize_model(config, arch, mode)
|
quantize_model(config, arch, mode)
|
||||||
|
|
||||||
logger.info("The FLOPs and Params of Arch:")
|
|
||||||
try:
|
|
||||||
flops = paddle.flops(arch, [1, *config["Global"]["image_shape"]])
|
|
||||||
except Exception as e:
|
|
||||||
logger.warning(
|
|
||||||
f"An error occurred when calculating FLOPs and Params of Arch. Please check the Global.image_shape in config. The details of error is: {e}"
|
|
||||||
)
|
|
||||||
|
|
||||||
return arch
|
return arch
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user