Skip to content

Commit

Permalink
Fix tests of latencyPredictor. (PaddlePaddle#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzjjay authored Sep 27, 2022
1 parent 438e5ec commit 8b445e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion paddleslim/analysis/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def opt_model(opt="paddle_lite_opt",
model_out = os.path.join(model_out, 'model')
else:
model_out = model_out + '.nb'
assert os.path.exists(
model_out
), 'There is an error during \'opt\' conversion model, please check the above error message.'
return model_out


Expand Down Expand Up @@ -133,7 +136,8 @@ def save_cls_model(model, input_shape, save_dir, data_type):
batch_size=input_shape[0],
batch_nums=1,
weight_bits=8,
activation_bits=8)
activation_bits=8,
quantizable_op_type=["conv2d", "depthwise_conv2d"])

model_file = os.path.join(quantize_model_path, 'model.pdmodel')
param_file = os.path.join(quantize_model_path, 'model.pdiparams')
Expand Down
2 changes: 1 addition & 1 deletion paddleslim/analysis/latency_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import time
import os
import pip
import platform
Expand Down

0 comments on commit 8b445e9

Please sign in to comment.