提交 47461da0 编写于 作者: W wanghaoshuang

Merge branch 'fix_py3' into 'develop'

fix for py3

See merge request !75
...@@ -11,13 +11,8 @@ ...@@ -11,13 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import flops as flops_module from .flops import flops
from flops import * from .model_size import model_size
import model_size as model_size_module from .latency import LatencyEvaluator, TableLatencyEvaluator
from model_size import *
import latency as latency_module __all__ = ['flops', 'model_size', 'LatencyEvaluator', 'TableLatencyEvaluator']
from latency import *
__all__ = []
__all__ += flops_module.__all__
__all__ += model_size_module.__all__
__all__ += latency_module.__all__
...@@ -11,25 +11,15 @@ ...@@ -11,25 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import controller from .controller import EvolutionaryController
from controller import * from .sa_controller import SAController
import sa_controller from .log_helper import get_logger
from sa_controller import * from .controller_server import ControllerServer
import log_helper from .controller_client import ControllerClient
from log_helper import * from .lock_utils import lock, unlock
import controller_server from .cached_reader import cached_reader
from controller_server import *
import controller_client
from controller_client import *
import lock_utils
from lock_utils import *
import cached_reader as cached_reader_module
from cached_reader import *
__all__ = [] __all__ = [
__all__ += controller.__all__ 'EvolutionaryController', 'SAController', 'get_logger', 'ControllerServer',
__all__ += sa_controller.__all__ 'ControllerClient', 'lock', 'unlock', 'cached_reader'
__all__ += controller_server.__all__ ]
__all__ += controller_client.__all__
__all__ += lock_utils.__all__
__all__ += cached_reader_module.__all__
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import logging import logging
import socket import socket
from log_helper import get_logger from .log_helper import get_logger
__all__ = ['ControllerClient'] __all__ = ['ControllerClient']
......
...@@ -107,7 +107,7 @@ class ControllerServer(object): ...@@ -107,7 +107,7 @@ class ControllerServer(object):
_logger.debug("send message to {}: [{}]".format(addr, _logger.debug("send message to {}: [{}]".format(addr,
tokens)) tokens))
conn.close() conn.close()
except Exception, err: except Exception as err:
_logger.error(err) _logger.error(err)
finally: finally:
self._socket_server.close() self._socket_server.close()
......
...@@ -20,7 +20,7 @@ import logging ...@@ -20,7 +20,7 @@ import logging
import numpy as np import numpy as np
import json import json
from .controller import EvolutionaryController from .controller import EvolutionaryController
from log_helper import get_logger from .log_helper import get_logger
__all__ = ["SAController"] __all__ = ["SAController"]
......
...@@ -12,10 +12,7 @@ ...@@ -12,10 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from . import graph_wrapper from .graph_wrapper import GraphWrapper, VarWrapper, OpWrapper
from .graph_wrapper import * from .registry import Registry
from . import registry
from .registry import *
__all__ = graph_wrapper.__all__ __all__ = ['GraphWrapper', 'VarWrapper', 'OpWrapper', 'Registry']
__all__ += registry.__all__
...@@ -12,11 +12,7 @@ ...@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import search_space from .search_space import *
from search_space import * from .sa_nas import SANAS
import sa_nas
from sa_nas import *
__all__ = [] __all__ = ['SANAS']
__all__ += search_space.__all__
__all__ += sa_nas.__all__
...@@ -64,7 +64,7 @@ class SANAS(object): ...@@ -64,7 +64,7 @@ class SANAS(object):
self._init_temperature = init_temperature self._init_temperature = init_temperature
self._is_server = is_server self._is_server = is_server
self._configs = configs self._configs = configs
self._key = hashlib.md5(str(self._configs)).hexdigest() self._key = hashlib.md5(str(self._configs).encode("utf-8")).hexdigest()
server_ip, server_port = server_addr server_ip, server_port = server_addr
if server_ip == None or server_ip == "": if server_ip == None or server_ip == "":
......
...@@ -12,27 +12,19 @@ ...@@ -12,27 +12,19 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import mobilenetv2 from .mobilenetv2 import MobileNetV2Space
from .mobilenetv2 import * from .mobilenetv1 import MobileNetV1Space
import mobilenet_block from .resnet import ResNetSpace
from .mobilenet_block import * from .mobilenet_block import MobileNetV1BlockSpace, MobileNetV2BlockSpace
import mobilenetv1 from .resnet_block import ResNetBlockSpace
from .mobilenetv1 import * from .inception_block import InceptionABlockSpace, InceptionCBlockSpace
import resnet from .search_space_registry import SEARCHSPACE
from .resnet import * from .search_space_factory import SearchSpaceFactory
import resnet_block from .search_space_base import SearchSpaceBase
from .resnet_block import *
import inception_block
from .inception_block import *
import search_space_registry
from search_space_registry import *
import search_space_factory
from search_space_factory import *
import search_space_base
from search_space_base import *
__all__ = [] __all__ = [
__all__ += mobilenetv2.__all__ 'MobileNetV1Space', 'MobileNetV2Space', 'ResNetSpace',
__all__ += search_space_registry.__all__ 'MobileNetV1BlockSpace', 'MobileNetV2BlockSpace', 'ResNetBlockSpace',
__all__ += search_space_factory.__all__ 'InceptionABlockSpace', 'InceptionCBlockSpace', 'SearchSpaceBase',
__all__ += search_space_base.__all__ 'SearchSpaceFactory', 'SEARCHSPACE'
]
...@@ -28,4 +28,4 @@ class SearchSpaceFactory(object): ...@@ -28,4 +28,4 @@ class SearchSpaceFactory(object):
""" """
assert isinstance(config_lists, list), "configs must be a list" assert isinstance(config_lists, list), "configs must be a list"
return CombineSearchSpace(config_lists) return CombineSearchSpace(config_lists)
...@@ -11,23 +11,14 @@ ...@@ -11,23 +11,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import pruner from .pruner import Pruner
from pruner import * from .auto_pruner import AutoPruner
import auto_pruner from .controller_server import ControllerServer
from auto_pruner import * from .controller_client import ControllerClient
import controller_server from .sensitive_pruner import SensitivePruner
from controller_server import * from .sensitive import sensitivity, flops_sensitivity
import controller_client
from controller_client import *
import sensitive_pruner
from sensitive_pruner import *
import sensitive
from sensitive import *
__all__ = [] __all__ = [
__all__ += pruner.__all__ 'Pruner', 'AutoPruner', 'ControllerServer', 'ControllerClient',
__all__ += auto_pruner.__all__ 'SensitivePruner', 'sensitivity', 'flops_sensitivity'
__all__ += controller_server.__all__ ]
__all__ += controller_client.__all__
__all__ += sensitive_pruner.__all__
__all__ += sensitive.__all__
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册