From 1ab674bf2e48bc32c235d24a2987f89397a18189 Mon Sep 17 00:00:00 2001 From: huangjun12 <2399845970@qq.com> Date: Tue, 29 Oct 2019 19:14:46 +0800 Subject: [PATCH] fix raise statement in python3 (#3802) * fix raise statement in python3 * modify README of bmn data --- PaddleCV/PaddleVideo/data/dataset/bmn/README.md | 6 +----- .../PaddleVideo/models/nonlocal_model/nonlocal_utils.py | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/PaddleCV/PaddleVideo/data/dataset/bmn/README.md b/PaddleCV/PaddleVideo/data/dataset/bmn/README.md index 595e1d7e..5fc024f0 100644 --- a/PaddleCV/PaddleVideo/data/dataset/bmn/README.md +++ b/PaddleCV/PaddleVideo/data/dataset/bmn/README.md @@ -8,8 +8,4 @@ BMN模型使用ActivityNet 1.3数据集,使用方法有如下两种方式: 方式二: -我们也在[百度网盘](https://pan.baidu.com/s/19GI3_-uZbd_XynUO6g-8YQ)和[谷歌云盘](https://drive.google.com/file/d/1ISemndlSDS2FtqQOKL0t3Cjj9yk2yznF/view?usp=sharing)提供了处理好的视频特征。若使用百度网盘下载,在解压前请使用如下命令: - - cat zip_csv_mean_100.z* > csv_mean_100.zip - -解压完成后,请相应修改configs/bmn.yaml文件中的特征路径feat\_path。 +我们也提供了处理好的视频特征,请下载[bmn\_feat](https://paddlemodels.bj.bcebos.com/video_detection/bmn_feat.tar.gz)数据后解压,同时相应的修改configs/bmn.yaml文件中的特征路径feat\_path。 diff --git a/PaddleCV/PaddleVideo/models/nonlocal_model/nonlocal_utils.py b/PaddleCV/PaddleVideo/models/nonlocal_model/nonlocal_utils.py index f8deb380..eee10b36 100644 --- a/PaddleCV/PaddleVideo/models/nonlocal_model/nonlocal_utils.py +++ b/PaddleCV/PaddleVideo/models/nonlocal_model/nonlocal_utils.py @@ -126,8 +126,9 @@ def load_pretrain_params_from_file(exe, prog, pretrained_file, place): prog_tensor.set(new_value, place) logger.info("load param {}".format(name)) else: - raise TypeError, \ - "pretrained file is not in a directory, not suitable to load params".format(pretrained_file) + raise TypeError( + "pretrained file {} is not in a directory, not suitable to load params". + format(pretrained_file)) def get_common_names(param_name_list, param_name_from_file): -- GitLab