From 8d82a06a85eb0da45e87e118180ffd8506ab8513 Mon Sep 17 00:00:00 2001 From: tangwei Date: Tue, 19 May 2020 11:21:45 +0800 Subject: [PATCH] remove unused import --- core/engine/cluster/cloud/cluster.sh | 14 ++++++++++++++ core/engine/cluster/cluster.py | 1 - core/model.py | 1 - core/trainers/cluster_trainer.py | 1 - core/trainers/tdm_cluster_trainer.py | 2 -- core/trainers/tdm_single_trainer.py | 1 - core/utils/dataloader_instance.py | 1 - core/utils/table.py | 3 --- .../contentunderstanding/classification/model.py | 7 +------ .../contentunderstanding/classification/reader.py | 13 ++----------- models/contentunderstanding/tagspace/model.py | 4 ---- models/contentunderstanding/tagspace/reader.py | 10 +--------- models/match/dssm/model.py | 1 - models/match/dssm/synthetic_evaluate_reader.py | 1 - models/match/dssm/synthetic_reader.py | 1 - models/match/multiview-simnet/data_process.sh | 15 +++++++++++++++ models/match/multiview-simnet/evaluate_reader.py | 5 +---- models/match/multiview-simnet/model.py | 3 --- models/match/multiview-simnet/reader.py | 5 +---- .../multitask/share-bottom/census_infer_reader.py | 2 -- models/multitask/share-bottom/census_reader.py | 3 +-- models/multitask/share-bottom/model.py | 1 - models/rank/dcn/criteo_reader.py | 2 -- models/rank/dcn/model.py | 1 - models/rank/din/model.py | 1 - models/rank/wide_deep/reader.py | 1 - models/rank/xdeepfm/criteo_reader.py | 1 - models/rank/xdeepfm/model.py | 1 - models/recall/gnn/data_process.sh | 14 ++++++++++++++ models/recall/gnn/evaluate_reader.py | 2 +- models/recall/gnn/reader.py | 2 +- models/recall/gru4rec/hdfs.log | 0 models/recall/gru4rec/model.py | 1 - models/recall/gru4rec/rsc15_infer_reader.py | 1 - models/recall/gru4rec/rsc15_reader.py | 1 - models/recall/ssr/model.py | 2 -- models/recall/ssr/ssr_infer_reader.py | 1 - models/recall/ssr/ssr_reader.py | 1 - models/recall/word2vec/prepare_data.sh | 15 +++++++++++++++ models/recall/word2vec/w2v_evaluate_reader.py | 1 - setup.py | 14 ++++++++++++++ 41 files changed, 81 insertions(+), 76 deletions(-) delete mode 100644 models/recall/gru4rec/hdfs.log diff --git a/core/engine/cluster/cloud/cluster.sh b/core/engine/cluster/cloud/cluster.sh index 1140d791..1a0605fd 100644 --- a/core/engine/cluster/cloud/cluster.sh +++ b/core/engine/cluster/cloud/cluster.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + ################################################### # Usage: submit.sh diff --git a/core/engine/cluster/cluster.py b/core/engine/cluster/cluster.py index 0f45b1b0..3ce6bf66 100644 --- a/core/engine/cluster/cluster.py +++ b/core/engine/cluster/cluster.py @@ -16,7 +16,6 @@ from __future__ import print_function from __future__ import unicode_literals import subprocess -import sys import os import copy diff --git a/core/model.py b/core/model.py index c51ba241..fbafc695 100755 --- a/core/model.py +++ b/core/model.py @@ -15,7 +15,6 @@ import abc import paddle.fluid as fluid - from paddlerec.core.utils import envs diff --git a/core/trainers/cluster_trainer.py b/core/trainers/cluster_trainer.py index fa4238bf..327dffe0 100755 --- a/core/trainers/cluster_trainer.py +++ b/core/trainers/cluster_trainer.py @@ -25,7 +25,6 @@ import paddle.fluid as fluid from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.base.role_maker import PaddleCloudRoleMaker -from paddle.fluid.incubate.fleet.base.role_maker import MPISymetricRoleMaker from paddlerec.core.utils import envs from paddlerec.core.trainers.transpiler_trainer import TranspileTrainer diff --git a/core/trainers/tdm_cluster_trainer.py b/core/trainers/tdm_cluster_trainer.py index f4edc62a..60e87bfd 100755 --- a/core/trainers/tdm_cluster_trainer.py +++ b/core/trainers/tdm_cluster_trainer.py @@ -21,8 +21,6 @@ import logging import numpy as np import paddle.fluid as fluid from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet -from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory -from paddle.fluid.incubate.fleet.base.role_maker import PaddleCloudRoleMaker from paddlerec.core.utils import envs from paddlerec.core.trainers.cluster_trainer import ClusterTrainer diff --git a/core/trainers/tdm_single_trainer.py b/core/trainers/tdm_single_trainer.py index dce3c8d5..8890ffd7 100755 --- a/core/trainers/tdm_single_trainer.py +++ b/core/trainers/tdm_single_trainer.py @@ -20,7 +20,6 @@ from __future__ import print_function import logging import paddle.fluid as fluid -from paddlerec.core.trainers.transpiler_trainer import TranspileTrainer from paddlerec.core.trainers.single_trainer import SingleTrainer from paddlerec.core.utils import envs import numpy as np diff --git a/core/utils/dataloader_instance.py b/core/utils/dataloader_instance.py index 88b4a9f6..6234882f 100755 --- a/core/utils/dataloader_instance.py +++ b/core/utils/dataloader_instance.py @@ -14,7 +14,6 @@ from __future__ import print_function import os -import sys from paddlerec.core.utils.envs import lazy_instance_by_fliename from paddlerec.core.utils.envs import get_global_env diff --git a/core/utils/table.py b/core/utils/table.py index 7c86d0f0..08b7e5a0 100755 --- a/core/utils/table.py +++ b/core/utils/table.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy -import yaml - class TableMeta(object): """ diff --git a/models/contentunderstanding/classification/model.py b/models/contentunderstanding/classification/model.py index e4630820..46869b44 100644 --- a/models/contentunderstanding/classification/model.py +++ b/models/contentunderstanding/classification/model.py @@ -12,16 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle.fluid as fluid -import math -from paddlerec.core.utils import envs from paddlerec.core.model import Model as ModelBase import paddle.fluid as fluid -import paddle.fluid.layers.nn as nn -import paddle.fluid.layers.tensor as tensor -import paddle.fluid.layers.control_flow as cf + class Model(ModelBase): def __init__(self, config): diff --git a/models/contentunderstanding/classification/reader.py b/models/contentunderstanding/classification/reader.py index f90097d7..8c3f5486 100644 --- a/models/contentunderstanding/classification/reader.py +++ b/models/contentunderstanding/classification/reader.py @@ -12,20 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import re + import sys -import collections -import os -import six -import time -import numpy as np -import paddle.fluid as fluid -import paddle -import csv -import io + from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs class TrainReader(Reader): def init(self): diff --git a/models/contentunderstanding/tagspace/model.py b/models/contentunderstanding/tagspace/model.py index 8b73da91..7ed1fcf3 100644 --- a/models/contentunderstanding/tagspace/model.py +++ b/models/contentunderstanding/tagspace/model.py @@ -12,10 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle.fluid as fluid -import math - -from paddlerec.core.utils import envs from paddlerec.core.model import Model as ModelBase import paddle.fluid as fluid diff --git a/models/contentunderstanding/tagspace/reader.py b/models/contentunderstanding/tagspace/reader.py index fb973f7e..8c912a68 100644 --- a/models/contentunderstanding/tagspace/reader.py +++ b/models/contentunderstanding/tagspace/reader.py @@ -12,17 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import re + import sys -import collections -import os -import six -import time import numpy as np -import paddle.fluid as fluid -import paddle -import csv -import io from paddlerec.core.reader import Reader from paddlerec.core.utils import envs diff --git a/models/match/dssm/model.py b/models/match/dssm/model.py index ef77a8f0..e1944628 100755 --- a/models/match/dssm/model.py +++ b/models/match/dssm/model.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import paddle.fluid as fluid from paddlerec.core.utils import envs diff --git a/models/match/dssm/synthetic_evaluate_reader.py b/models/match/dssm/synthetic_evaluate_reader.py index 1be5b13d..97f50abf 100755 --- a/models/match/dssm/synthetic_evaluate_reader.py +++ b/models/match/dssm/synthetic_evaluate_reader.py @@ -14,7 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs class EvaluateReader(Reader): diff --git a/models/match/dssm/synthetic_reader.py b/models/match/dssm/synthetic_reader.py index c4cfaf6d..cc829374 100755 --- a/models/match/dssm/synthetic_reader.py +++ b/models/match/dssm/synthetic_reader.py @@ -14,7 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs class TrainReader(Reader): diff --git a/models/match/multiview-simnet/data_process.sh b/models/match/multiview-simnet/data_process.sh index 15c6c908..91548c58 100755 --- a/models/match/multiview-simnet/data_process.sh +++ b/models/match/multiview-simnet/data_process.sh @@ -1,5 +1,20 @@ #! /bin/bash +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + + set -e echo "begin to prepare data" diff --git a/models/match/multiview-simnet/evaluate_reader.py b/models/match/multiview-simnet/evaluate_reader.py index b6aa5799..b68bae05 100755 --- a/models/match/multiview-simnet/evaluate_reader.py +++ b/models/match/multiview-simnet/evaluate_reader.py @@ -11,10 +11,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 numpy as np -import io -import copy -import random + from paddlerec.core.reader import Reader from paddlerec.core.utils import envs diff --git a/models/match/multiview-simnet/model.py b/models/match/multiview-simnet/model.py index aa8d8db6..cee41bad 100755 --- a/models/match/multiview-simnet/model.py +++ b/models/match/multiview-simnet/model.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import math import paddle.fluid as fluid -import paddle.fluid.layers as layers import paddle.fluid.layers.tensor as tensor import paddle.fluid.layers.control_flow as cf diff --git a/models/match/multiview-simnet/reader.py b/models/match/multiview-simnet/reader.py index ea41fa88..0ccec660 100755 --- a/models/match/multiview-simnet/reader.py +++ b/models/match/multiview-simnet/reader.py @@ -11,10 +11,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 numpy as np -import io -import copy -import random + from paddlerec.core.reader import Reader from paddlerec.core.utils import envs diff --git a/models/multitask/share-bottom/census_infer_reader.py b/models/multitask/share-bottom/census_infer_reader.py index c25ccea8..d4071a1b 100644 --- a/models/multitask/share-bottom/census_infer_reader.py +++ b/models/multitask/share-bottom/census_infer_reader.py @@ -14,8 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs -import numpy as np class EvaluateReader(Reader): diff --git a/models/multitask/share-bottom/census_reader.py b/models/multitask/share-bottom/census_reader.py index 30997c63..abe6ba9a 100644 --- a/models/multitask/share-bottom/census_reader.py +++ b/models/multitask/share-bottom/census_reader.py @@ -11,11 +11,10 @@ # 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. + from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs -import numpy as np class TrainReader(Reader): diff --git a/models/multitask/share-bottom/model.py b/models/multitask/share-bottom/model.py index a9172995..b6643828 100644 --- a/models/multitask/share-bottom/model.py +++ b/models/multitask/share-bottom/model.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import paddle.fluid as fluid from paddlerec.core.utils import envs diff --git a/models/rank/dcn/criteo_reader.py b/models/rank/dcn/criteo_reader.py index a526d0fc..5c180ee2 100755 --- a/models/rank/dcn/criteo_reader.py +++ b/models/rank/dcn/criteo_reader.py @@ -13,7 +13,6 @@ # limitations under the License. from __future__ import print_function import math -import sys from paddlerec.core.reader import Reader from paddlerec.core.utils import envs @@ -21,7 +20,6 @@ try: import cPickle as pickle except ImportError: import pickle -from collections import Counter import os class TrainReader(Reader): diff --git a/models/rank/dcn/model.py b/models/rank/dcn/model.py index 7fbb3c6a..d9292492 100755 --- a/models/rank/dcn/model.py +++ b/models/rank/dcn/model.py @@ -13,7 +13,6 @@ # limitations under the License. import paddle.fluid as fluid -import math from paddlerec.core.utils import envs from paddlerec.core.model import Model as ModelBase diff --git a/models/rank/din/model.py b/models/rank/din/model.py index e218bb7f..2abc658b 100755 --- a/models/rank/din/model.py +++ b/models/rank/din/model.py @@ -13,7 +13,6 @@ # limitations under the License. import paddle.fluid as fluid -import math from paddlerec.core.utils import envs from paddlerec.core.model import Model as ModelBase diff --git a/models/rank/wide_deep/reader.py b/models/rank/wide_deep/reader.py index 945dd4a5..f2a1058f 100755 --- a/models/rank/wide_deep/reader.py +++ b/models/rank/wide_deep/reader.py @@ -14,7 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs try: import cPickle as pickle except ImportError: diff --git a/models/rank/xdeepfm/criteo_reader.py b/models/rank/xdeepfm/criteo_reader.py index ee2dac5d..237d7d6d 100755 --- a/models/rank/xdeepfm/criteo_reader.py +++ b/models/rank/xdeepfm/criteo_reader.py @@ -14,7 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs try: import cPickle as pickle except ImportError: diff --git a/models/rank/xdeepfm/model.py b/models/rank/xdeepfm/model.py index d92ce81e..14b57ffb 100755 --- a/models/rank/xdeepfm/model.py +++ b/models/rank/xdeepfm/model.py @@ -13,7 +13,6 @@ # limitations under the License. import paddle.fluid as fluid -import math from paddlerec.core.utils import envs from paddlerec.core.model import Model as ModelBase diff --git a/models/recall/gnn/data_process.sh b/models/recall/gnn/data_process.sh index 9aa009f0..38877b69 100755 --- a/models/recall/gnn/data_process.sh +++ b/models/recall/gnn/data_process.sh @@ -1,5 +1,19 @@ #! /bin/bash +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + set -e echo "begin to download data" diff --git a/models/recall/gnn/evaluate_reader.py b/models/recall/gnn/evaluate_reader.py index 3f628776..4ced177e 100755 --- a/models/recall/gnn/evaluate_reader.py +++ b/models/recall/gnn/evaluate_reader.py @@ -11,8 +11,8 @@ # 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 numpy as np -import io import copy import random from paddlerec.core.reader import Reader diff --git a/models/recall/gnn/reader.py b/models/recall/gnn/reader.py index a2b5eac1..d9aab524 100755 --- a/models/recall/gnn/reader.py +++ b/models/recall/gnn/reader.py @@ -11,8 +11,8 @@ # 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 numpy as np -import io import copy import random from paddlerec.core.reader import Reader diff --git a/models/recall/gru4rec/hdfs.log b/models/recall/gru4rec/hdfs.log deleted file mode 100644 index e69de29b..00000000 diff --git a/models/recall/gru4rec/model.py b/models/recall/gru4rec/model.py index d77f3c25..32435416 100644 --- a/models/recall/gru4rec/model.py +++ b/models/recall/gru4rec/model.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import paddle.fluid as fluid from paddlerec.core.utils import envs diff --git a/models/recall/gru4rec/rsc15_infer_reader.py b/models/recall/gru4rec/rsc15_infer_reader.py index 829726e3..4bde64cb 100644 --- a/models/recall/gru4rec/rsc15_infer_reader.py +++ b/models/recall/gru4rec/rsc15_infer_reader.py @@ -14,7 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs class EvaluateReader(Reader): diff --git a/models/recall/gru4rec/rsc15_reader.py b/models/recall/gru4rec/rsc15_reader.py index eeb2441d..0abd6f41 100644 --- a/models/recall/gru4rec/rsc15_reader.py +++ b/models/recall/gru4rec/rsc15_reader.py @@ -14,7 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs class TrainReader(Reader): diff --git a/models/recall/ssr/model.py b/models/recall/ssr/model.py index 3f93c8a1..e11e0cf1 100644 --- a/models/recall/ssr/model.py +++ b/models/recall/ssr/model.py @@ -12,13 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import math import paddle.fluid as fluid from paddlerec.core.utils import envs from paddlerec.core.model import Model as ModelBase import paddle.fluid.layers.tensor as tensor -import paddle.fluid.layers.io as io import paddle.fluid.layers.control_flow as cf diff --git a/models/recall/ssr/ssr_infer_reader.py b/models/recall/ssr/ssr_infer_reader.py index b9e5f726..5a40280b 100644 --- a/models/recall/ssr/ssr_infer_reader.py +++ b/models/recall/ssr/ssr_infer_reader.py @@ -15,7 +15,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader from paddlerec.core.utils import envs -import random import numpy as np diff --git a/models/recall/ssr/ssr_reader.py b/models/recall/ssr/ssr_reader.py index e2a35265..ba004575 100644 --- a/models/recall/ssr/ssr_reader.py +++ b/models/recall/ssr/ssr_reader.py @@ -14,7 +14,6 @@ from __future__ import print_function from paddlerec.core.reader import Reader -from paddlerec.core.utils import envs import random diff --git a/models/recall/word2vec/prepare_data.sh b/models/recall/word2vec/prepare_data.sh index 743ae998..8b78eeed 100755 --- a/models/recall/word2vec/prepare_data.sh +++ b/models/recall/word2vec/prepare_data.sh @@ -1,5 +1,20 @@ #! /bin/bash +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + + # download train_data mkdir raw_data wget --no-check-certificate https://paddlerec.bj.bcebos.com/word2vec/1-billion-word-language-modeling-benchmark-r13output.tar diff --git a/models/recall/word2vec/w2v_evaluate_reader.py b/models/recall/word2vec/w2v_evaluate_reader.py index 7ab49886..96d483db 100755 --- a/models/recall/word2vec/w2v_evaluate_reader.py +++ b/models/recall/word2vec/w2v_evaluate_reader.py @@ -11,7 +11,6 @@ # 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 numpy as np import io import six from paddlerec.core.reader import Reader diff --git a/setup.py b/setup.py index f3e97f97..ab0c2792 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + """ setup for paddle-rec. """ -- GitLab