diff --git a/fluid/DeepASR/model_utils/model.py b/fluid/DeepASR/model_utils/model.py index 8ae7e66fc781226c0316fceee65cfb805a1770ba..31892a7ad93eed0ba6ad6e7b53377e897f6df29d 100644 --- a/fluid/DeepASR/model_utils/model.py +++ b/fluid/DeepASR/model_utils/model.py @@ -2,7 +2,6 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import paddle.v2 as paddle import paddle.fluid as fluid diff --git a/fluid/adversarial/tutorials/mnist_model.py b/fluid/adversarial/tutorials/mnist_model.py index 81ff7bdec7bedde2e5d1d1013ad95841cb766510..b1ebb0f88752df4c18ddd4ad96725f636bf261fc 100644 --- a/fluid/adversarial/tutorials/mnist_model.py +++ b/fluid/adversarial/tutorials/mnist_model.py @@ -1,7 +1,7 @@ """ CNN on mnist data using fluid api of paddlepaddle """ -import paddle.v2 as paddle +import paddle import paddle.fluid as fluid diff --git a/fluid/adversarial/tutorials/mnist_tutorial_bim.py b/fluid/adversarial/tutorials/mnist_tutorial_bim.py index b490eba302106cf80df009d30e2babe48af465df..0524b908ea9ed028cf03aa9621c08fb8ef0cfc79 100644 --- a/fluid/adversarial/tutorials/mnist_tutorial_bim.py +++ b/fluid/adversarial/tutorials/mnist_tutorial_bim.py @@ -8,7 +8,7 @@ sys.path.append("..") import matplotlib.pyplot as plt import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from advbox.adversary import Adversary from advbox.attacks.gradient_method import BIM diff --git a/fluid/adversarial/tutorials/mnist_tutorial_deepfool.py b/fluid/adversarial/tutorials/mnist_tutorial_deepfool.py index 2b12c81945859b42809e33ccd74ead53f4d4eb05..74ab5e8040022f4df96dd97fc77da9dc920d8f2b 100644 --- a/fluid/adversarial/tutorials/mnist_tutorial_deepfool.py +++ b/fluid/adversarial/tutorials/mnist_tutorial_deepfool.py @@ -8,7 +8,7 @@ sys.path.append("..") import matplotlib.pyplot as plt import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from advbox.adversary import Adversary from advbox.attacks.deepfool import DeepFoolAttack diff --git a/fluid/adversarial/tutorials/mnist_tutorial_fgsm.py b/fluid/adversarial/tutorials/mnist_tutorial_fgsm.py index eeb7bc477ed090eac547fe3db50b08b2a513f0d7..178fc146dd636dce8fa2f82552a996dca239c55a 100644 --- a/fluid/adversarial/tutorials/mnist_tutorial_fgsm.py +++ b/fluid/adversarial/tutorials/mnist_tutorial_fgsm.py @@ -8,7 +8,7 @@ sys.path.append("..") import matplotlib.pyplot as plt import numpy as np import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from advbox.adversary import Adversary from advbox.attacks.gradient_method import FGSM diff --git a/fluid/adversarial/tutorials/mnist_tutorial_ilcm.py b/fluid/adversarial/tutorials/mnist_tutorial_ilcm.py index 3d155e583415962f62ee7f581d32dd57a6b1cc1b..b12ffaab0367769d9bf9d58ec7396c8edd2487e9 100644 --- a/fluid/adversarial/tutorials/mnist_tutorial_ilcm.py +++ b/fluid/adversarial/tutorials/mnist_tutorial_ilcm.py @@ -7,7 +7,7 @@ sys.path.append("..") import matplotlib.pyplot as plt import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from advbox.adversary import Adversary from advbox.attacks.gradient_method import ILCM diff --git a/fluid/adversarial/tutorials/mnist_tutorial_jsma.py b/fluid/adversarial/tutorials/mnist_tutorial_jsma.py index 070d2f5f5e3bcd50cdfb12f67e7c1a9453f31676..98829ec33afa1abc7646ac9297ec82c3de9b9eff 100644 --- a/fluid/adversarial/tutorials/mnist_tutorial_jsma.py +++ b/fluid/adversarial/tutorials/mnist_tutorial_jsma.py @@ -7,7 +7,7 @@ sys.path.append("..") import matplotlib.pyplot as plt import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from advbox.adversary import Adversary from advbox.attacks.saliency import JSMA diff --git a/fluid/adversarial/tutorials/mnist_tutorial_lbfgs.py b/fluid/adversarial/tutorials/mnist_tutorial_lbfgs.py index 9b16c32bb6543409c487b31fe80d8cdc162b55d1..ba120d9d151573878372e394d2a03d93efccb4e9 100644 --- a/fluid/adversarial/tutorials/mnist_tutorial_lbfgs.py +++ b/fluid/adversarial/tutorials/mnist_tutorial_lbfgs.py @@ -7,7 +7,7 @@ sys.path.append("..") import matplotlib.pyplot as plt import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from advbox.adversary import Adversary from advbox.attacks.lbfgs import LBFGS diff --git a/fluid/adversarial/tutorials/mnist_tutorial_mifgsm.py b/fluid/adversarial/tutorials/mnist_tutorial_mifgsm.py index ded7ef4b19cd4d99d2c3143f703e3d594058f705..8fc84db8f673c8da8eebf8b9d96f41a8712146c8 100644 --- a/fluid/adversarial/tutorials/mnist_tutorial_mifgsm.py +++ b/fluid/adversarial/tutorials/mnist_tutorial_mifgsm.py @@ -9,7 +9,7 @@ sys.path.append("..") import matplotlib.pyplot as plt import numpy as np import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from advbox.adversary import Adversary from advbox.attacks.gradient_method import MIFGSM diff --git a/fluid/icnet/infer.py b/fluid/icnet/infer.py index f93469f157660a4c5adae7d4ff2bc9b315bce41e..9f556fc00d5fe0346cb063d90a770ee7c9ab32b5 100644 --- a/fluid/icnet/infer.py +++ b/fluid/icnet/infer.py @@ -8,7 +8,7 @@ import os import cv2 import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle from icnet import icnet from utils import add_arguments, print_arguments, get_feeder_data from paddle.fluid.layers.learning_rate_scheduler import _decay_step_counter @@ -111,10 +111,10 @@ def infer(args): for line in open(args.images_list): image_file = args.images_path + "/" + line.strip() filename = os.path.basename(image_file) - image = paddle.image.load_image( + image = paddle.dataset.image.load_image( image_file, is_color=True).astype("float32") image -= IMG_MEAN - img = paddle.image.to_chw(image)[np.newaxis, :] + img = paddle.dataset.image.to_chw(image)[np.newaxis, :] image_t = fluid.core.LoDTensor() image_t.set(img, place) result = exe.run(inference_program, diff --git a/fluid/image_classification/caffe2fluid/examples/mnist/evaluate.py b/fluid/image_classification/caffe2fluid/examples/mnist/evaluate.py index 946fa943726b39c4e8e8dfce9f41c87a06ee1912..55b053e85b9f02e218511fed477757ffb3feee23 100644 --- a/fluid/image_classification/caffe2fluid/examples/mnist/evaluate.py +++ b/fluid/image_classification/caffe2fluid/examples/mnist/evaluate.py @@ -8,7 +8,7 @@ import sys import os import numpy as np import paddle.fluid as fluid -import paddle.v2 as paddle +import paddle def test_model(exe, test_program, fetch_list, test_reader, feeder): diff --git a/fluid/metric_learning/losses/datareader.py b/fluid/metric_learning/losses/datareader.py index 97c401e5ae5c08eac4152359e71c6237fd129d28..c3f04eb96665fee339d8e70fa86d691a26c09031 100644 --- a/fluid/metric_learning/losses/datareader.py +++ b/fluid/metric_learning/losses/datareader.py @@ -4,7 +4,6 @@ import random import cPickle import functools import numpy as np -#import paddle.v2 as paddle import paddle from PIL import Image, ImageEnhance diff --git a/fluid/ocr_recognition/eval.py b/fluid/ocr_recognition/eval.py index 1d553999eb545e3a1134658e78592fb74a4a8c3c..a19ca4a34f9b89809dce3d87cf10d5348850f4e2 100644 --- a/fluid/ocr_recognition/eval.py +++ b/fluid/ocr_recognition/eval.py @@ -1,4 +1,3 @@ -import paddle.v2 as paddle import paddle.fluid as fluid from utility import add_arguments, print_arguments, to_lodtensor, get_ctc_feeder_data, get_attention_feeder_data from attention_model import attention_eval diff --git a/fluid/ocr_recognition/infer.py b/fluid/ocr_recognition/infer.py index 6a28314dc3abf551ef016a4f61e973643d000b2b..5c3e1f240c45af2421e4fd15165d590a81db02ae 100755 --- a/fluid/ocr_recognition/infer.py +++ b/fluid/ocr_recognition/infer.py @@ -1,5 +1,4 @@ from __future__ import print_function -import paddle.v2 as paddle import paddle.fluid as fluid from utility import add_arguments, print_arguments, to_lodtensor, get_ctc_feeder_data, get_attention_feeder_for_infer import paddle.fluid.profiler as profiler diff --git a/fluid/policy_gradient/brain.py b/fluid/policy_gradient/brain.py index 314aec52ea56a3887e14e69786107d7b98319ab2..27a2da28563e5063213100d34c1b88d5fe2f91b0 100644 --- a/fluid/policy_gradient/brain.py +++ b/fluid/policy_gradient/brain.py @@ -1,5 +1,4 @@ import numpy as np -import paddle.v2 as paddle import paddle.fluid as fluid # reproducible np.random.seed(1) diff --git a/fluid/video_classification/eval.py b/fluid/video_classification/eval.py index 91b8d445978f78b9b0883ac2717831904eca09bb..130e682c1b03e8203dd0d36124496bb82c81564c 100644 --- a/fluid/video_classification/eval.py +++ b/fluid/video_classification/eval.py @@ -2,7 +2,7 @@ import os import numpy as np import time import sys -import paddle.v2 as paddle +import paddle import paddle.fluid as fluid from resnet import TSN_ResNet import reader diff --git a/fluid/video_classification/infer.py b/fluid/video_classification/infer.py index 1f3048b1a89f1f218248d6e5760d08683000343d..15cc2b53d918f70acf43da7eb1e095c1c03e0c4e 100644 --- a/fluid/video_classification/infer.py +++ b/fluid/video_classification/infer.py @@ -2,7 +2,7 @@ import os import numpy as np import time import sys -import paddle.v2 as paddle +import paddle import paddle.fluid as fluid from resnet import TSN_ResNet import reader diff --git a/fluid/video_classification/reader.py b/fluid/video_classification/reader.py index e688b66487f2615e19d468fa36f4cb2dc7578a54..11cfaa5b3ddc949d20f7f33d15f957cba5225919 100644 --- a/fluid/video_classification/reader.py +++ b/fluid/video_classification/reader.py @@ -5,7 +5,7 @@ import functools import cPickle from cStringIO import StringIO import numpy as np -import paddle.v2 as paddle +import paddle from PIL import Image, ImageEnhance random.seed(0) diff --git a/fluid/video_classification/train.py b/fluid/video_classification/train.py index a4171b2faf5fb63c37607fbe2fea21416c3e0441..c879bf688233dce5d1ce839af76ca41164e3a571 100644 --- a/fluid/video_classification/train.py +++ b/fluid/video_classification/train.py @@ -2,7 +2,7 @@ import os import numpy as np import time import sys -import paddle.v2 as paddle +import paddle import paddle.fluid as fluid from resnet import TSN_ResNet import reader