From 0eb840a9dc46a9425be973f82b31c527429e6b18 Mon Sep 17 00:00:00 2001 From: yajiedesign Date: Mon, 16 Jan 2017 09:12:29 +0800 Subject: [PATCH] fix import error with python3 fix alexnet and googlenet pooling pad error remove first pool pad. remove pad --- example/image-classification/benchmark.py | 2 +- example/image-classification/benchmark_score.py | 2 +- example/image-classification/{symbol => symbols}/README.md | 0 example/image-classification/{symbol => symbols}/__init__.py | 0 .../{symbol/googlenet.py => symbols/alexnet.py} | 2 -- .../{symbol/alexnet.py => symbols/googlenet.py} | 0 .../image-classification/{symbol => symbols}/inception-bn.py | 0 .../{symbol => symbols}/inception-resnet-v2.py | 0 .../image-classification/{symbol => symbols}/inception-v3.py | 0 example/image-classification/{symbol => symbols}/lenet.py | 0 example/image-classification/{symbol => symbols}/mlp.py | 0 example/image-classification/{symbol => symbols}/resnet.py | 0 example/image-classification/{symbol => symbols}/resnext.py | 0 example/image-classification/{symbol => symbols}/vgg.py | 0 example/image-classification/train_cifar10.py | 2 +- example/image-classification/train_imagenet.py | 2 +- example/image-classification/train_mnist.py | 2 +- 17 files changed, 5 insertions(+), 7 deletions(-) rename example/image-classification/{symbol => symbols}/README.md (100%) rename example/image-classification/{symbol => symbols}/__init__.py (100%) rename example/image-classification/{symbol/googlenet.py => symbols/alexnet.py} (99%) rename example/image-classification/{symbol/alexnet.py => symbols/googlenet.py} (100%) rename example/image-classification/{symbol => symbols}/inception-bn.py (100%) rename example/image-classification/{symbol => symbols}/inception-resnet-v2.py (100%) rename example/image-classification/{symbol => symbols}/inception-v3.py (100%) rename example/image-classification/{symbol => symbols}/lenet.py (100%) rename example/image-classification/{symbol => symbols}/mlp.py (100%) rename example/image-classification/{symbol => symbols}/resnet.py (100%) rename example/image-classification/{symbol => symbols}/resnext.py (100%) rename example/image-classification/{symbol => symbols}/vgg.py (100%) diff --git a/example/image-classification/benchmark.py b/example/image-classification/benchmark.py index c72389160443..5b040f3b09ff 100644 --- a/example/image-classification/benchmark.py +++ b/example/image-classification/benchmark.py @@ -86,7 +86,7 @@ def validate(self, attrs): sys.exit(1) try: #check if the network exists - importlib.import_module('symbol.'+ args[0]) + importlib.import_module('symbols.'+ args[0]) batch_size = int(args[1]) img_size = int(args[2]) return Network(name=args[0], batch_size=batch_size, img_size=img_size) diff --git a/example/image-classification/benchmark_score.py b/example/image-classification/benchmark_score.py index 4a2178745b23..f54b6aebb750 100644 --- a/example/image-classification/benchmark_score.py +++ b/example/image-classification/benchmark_score.py @@ -16,7 +16,7 @@ def get_symbol(network, batch_size): if 'resnet' in network: num_layers = int(network.split('-')[1]) network = 'resnet' - net = import_module('symbol.'+network) + net = import_module('symbols.'+network) sym = net.get_symbol(num_classes = 1000, image_shape = ','.join([str(i) for i in image_shape]), num_layers = num_layers) diff --git a/example/image-classification/symbol/README.md b/example/image-classification/symbols/README.md similarity index 100% rename from example/image-classification/symbol/README.md rename to example/image-classification/symbols/README.md diff --git a/example/image-classification/symbol/__init__.py b/example/image-classification/symbols/__init__.py similarity index 100% rename from example/image-classification/symbol/__init__.py rename to example/image-classification/symbols/__init__.py diff --git a/example/image-classification/symbol/googlenet.py b/example/image-classification/symbols/alexnet.py similarity index 99% rename from example/image-classification/symbol/googlenet.py rename to example/image-classification/symbols/alexnet.py index 052a6ecd8911..a533bf7d507e 100644 --- a/example/image-classification/symbol/googlenet.py +++ b/example/image-classification/symbols/alexnet.py @@ -5,8 +5,6 @@ with convolutions." arXiv preprint arXiv:1409.4842 (2014). """ - -import find_mxnet import mxnet as mx def ConvFactory(data, num_filter, kernel, stride=(1,1), pad=(0, 0), name=None, suffix=''): diff --git a/example/image-classification/symbol/alexnet.py b/example/image-classification/symbols/googlenet.py similarity index 100% rename from example/image-classification/symbol/alexnet.py rename to example/image-classification/symbols/googlenet.py diff --git a/example/image-classification/symbol/inception-bn.py b/example/image-classification/symbols/inception-bn.py similarity index 100% rename from example/image-classification/symbol/inception-bn.py rename to example/image-classification/symbols/inception-bn.py diff --git a/example/image-classification/symbol/inception-resnet-v2.py b/example/image-classification/symbols/inception-resnet-v2.py similarity index 100% rename from example/image-classification/symbol/inception-resnet-v2.py rename to example/image-classification/symbols/inception-resnet-v2.py diff --git a/example/image-classification/symbol/inception-v3.py b/example/image-classification/symbols/inception-v3.py similarity index 100% rename from example/image-classification/symbol/inception-v3.py rename to example/image-classification/symbols/inception-v3.py diff --git a/example/image-classification/symbol/lenet.py b/example/image-classification/symbols/lenet.py similarity index 100% rename from example/image-classification/symbol/lenet.py rename to example/image-classification/symbols/lenet.py diff --git a/example/image-classification/symbol/mlp.py b/example/image-classification/symbols/mlp.py similarity index 100% rename from example/image-classification/symbol/mlp.py rename to example/image-classification/symbols/mlp.py diff --git a/example/image-classification/symbol/resnet.py b/example/image-classification/symbols/resnet.py similarity index 100% rename from example/image-classification/symbol/resnet.py rename to example/image-classification/symbols/resnet.py diff --git a/example/image-classification/symbol/resnext.py b/example/image-classification/symbols/resnext.py similarity index 100% rename from example/image-classification/symbol/resnext.py rename to example/image-classification/symbols/resnext.py diff --git a/example/image-classification/symbol/vgg.py b/example/image-classification/symbols/vgg.py similarity index 100% rename from example/image-classification/symbol/vgg.py rename to example/image-classification/symbols/vgg.py diff --git a/example/image-classification/train_cifar10.py b/example/image-classification/train_cifar10.py index da94b51e8270..0186233d6ea2 100644 --- a/example/image-classification/train_cifar10.py +++ b/example/image-classification/train_cifar10.py @@ -46,7 +46,7 @@ def download_cifar10(): # load network from importlib import import_module - net = import_module('symbol.'+args.network) + net = import_module('symbols.'+args.network) sym = net.get_symbol(**vars(args)) # train diff --git a/example/image-classification/train_imagenet.py b/example/image-classification/train_imagenet.py index db190275a18b..710398b3cb57 100644 --- a/example/image-classification/train_imagenet.py +++ b/example/image-classification/train_imagenet.py @@ -33,7 +33,7 @@ # load network from importlib import import_module - net = import_module('symbol.'+args.network) + net = import_module('symbols.'+args.network) sym = net.get_symbol(**vars(args)) # train diff --git a/example/image-classification/train_mnist.py b/example/image-classification/train_mnist.py index 10d691e69af8..4243ddd23bda 100644 --- a/example/image-classification/train_mnist.py +++ b/example/image-classification/train_mnist.py @@ -69,7 +69,7 @@ def get_mnist_iter(args, kv): # load network from importlib import import_module - net = import_module('symbol.'+args.network) + net = import_module('symbols.'+args.network) sym = net.get_symbol(**vars(args)) # train