提交 4a54ed4d 编写于 作者: W wuyefeilin 提交者: wuzewu

update solver.py and model_builder.py (#110)

* update solver.py and model_builder.py

* update solver.py
上级 fc1b895b
...@@ -146,7 +146,7 @@ def build_model(main_prog, start_prog, phase=ModelPhase.TRAIN): ...@@ -146,7 +146,7 @@ def build_model(main_prog, start_prog, phase=ModelPhase.TRAIN):
if ModelPhase.is_predict(phase): if ModelPhase.is_predict(phase):
origin_image = fluid.layers.data( origin_image = fluid.layers.data(
name='image', name='image',
shape=[-1, 1, 1, cfg.DATASET.DATA_DIM], shape=[-1, -1, -1, cfg.DATASET.DATA_DIM],
dtype='float32', dtype='float32',
append_batch_size=False) append_batch_size=False)
image = fluid.layers.transpose(origin_image, [0, 3, 1, 2]) image = fluid.layers.transpose(origin_image, [0, 3, 1, 2])
......
...@@ -18,7 +18,10 @@ import paddle.fluid as fluid ...@@ -18,7 +18,10 @@ import paddle.fluid as fluid
import numpy as np import numpy as np
import importlib import importlib
from utils.config import cfg from utils.config import cfg
from paddle.fluid.contrib.mixed_precision.decorator import OptimizerWithMixedPrecison, decorate, AutoMixedPrecisionLists try:
from paddle.fluid.contrib.mixed_precision.decorator import OptimizerWithMixedPrecison, decorate, AutoMixedPrecisionLists
except:
from paddle.fluid.contrib.mixed_precision.decorator import OptimizerWithMixedPrecision, decorate, AutoMixedPrecisionLists
class Solver(object): class Solver(object):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册