diff --git a/agent/__init__.py b/agent/__init__.py index 1540617..f5dcc24 100644 --- a/agent/__init__.py +++ b/agent/__init__.py @@ -1,5 +1,5 @@ -from async_agent import * -from DDPG_agent import * -from DQN_agent import * -from A2C_agent import * -from MSDQN_agent import * +from .async_agent import * +from .DDPG_agent import * +from .DQN_agent import * +from .A2C_agent import * +from .MSDQN_agent import * diff --git a/async_worker/__init__.py b/async_worker/__init__.py index 874c26f..ee5e06e 100644 --- a/async_worker/__init__.py +++ b/async_worker/__init__.py @@ -1,6 +1,6 @@ -from actor_critic import * -from continuous_actor_critic import * -from n_step_q import * -from one_step_sarsa import * -from one_step_q import * -from ppo import * \ No newline at end of file +from .actor_critic import * +from .continuous_actor_critic import * +from .n_step_q import * +from .one_step_sarsa import * +from .one_step_q import * +from .ppo import * \ No newline at end of file diff --git a/component/__init__.py b/component/__init__.py index 0353ee5..fe77529 100644 --- a/component/__init__.py +++ b/component/__init__.py @@ -1,5 +1,5 @@ -from atari_wrapper import * -from policy import * -from replay import * -from task import * -from random_process import * \ No newline at end of file +from .atari_wrapper import * +from .policy import * +from .replay import * +from .task import * +from .random_process import * \ No newline at end of file diff --git a/component/task.py b/component/task.py index 6d46885..075757a 100644 --- a/component/task.py +++ b/component/task.py @@ -6,7 +6,7 @@ import gym import sys import numpy as np -from atari_wrapper import * +from .atari_wrapper import * class BasicTask: def __init__(self): diff --git a/network/__init__.py b/network/__init__.py index 5c009de..e0380e8 100644 --- a/network/__init__.py +++ b/network/__init__.py @@ -1,3 +1,3 @@ -from conv_network import * -from shallow_network import * -from continuous_action_network import * \ No newline at end of file +from .conv_network import * +from .shallow_network import * +from .continuous_action_network import * diff --git a/network/network.py b/network/base_network.py similarity index 100% rename from network/network.py rename to network/base_network.py diff --git a/network/continuous_action_network.py b/network/continuous_action_network.py index 83ad11a..c5144e5 100644 --- a/network/continuous_action_network.py +++ b/network/continuous_action_network.py @@ -4,7 +4,7 @@ # declaration at the top # ####################################################################### -from network import * +from .base_network import * class DeterministicActorNet(nn.Module, BasicNet): def __init__(self, diff --git a/network/conv_network.py b/network/conv_network.py index d8d6147..4951b4f 100644 --- a/network/conv_network.py +++ b/network/conv_network.py @@ -4,7 +4,7 @@ # declaration at the top # ####################################################################### -from network import * +from .base_network import * # Network for pixel Atari game with value based methods class NatureConvNet(nn.Module, VanillaNet): diff --git a/network/shallow_network.py b/network/shallow_network.py index 78cea12..148a2bb 100644 --- a/network/shallow_network.py +++ b/network/shallow_network.py @@ -4,7 +4,7 @@ # declaration at the top # ####################################################################### -from network import * +from .base_network import * # Network for CartPole with value based methods class FCNet(nn.Module, VanillaNet): diff --git a/utils/__init__.py b/utils/__init__.py index 69a6be6..ba7d6a7 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -1,7 +1,8 @@ -from config import * -from normalizer import * -from run import * +from .config import * +from .normalizer import * +from .run import * + try: - from tf_logger import Logger + from .tf_logger import Logger except: - from vanilla_logger import Logger \ No newline at end of file + from .vanilla_logger import Logger \ No newline at end of file diff --git a/utils/tf_logger.py b/utils/tf_logger.py index 2938de5..2b53f71 100644 --- a/utils/tf_logger.py +++ b/utils/tf_logger.py @@ -3,6 +3,7 @@ import tensorflow as tf import numpy as np import scipy.misc +import logging try: from StringIO import StringIO # Python 2.7 @@ -18,6 +19,7 @@ class Logger(object): self.debug = vanilla_logger.debug self.warning = vanilla_logger.warning self.skip = skip + logging.info('') def scalar_summary(self, tag, value, step): if self.skip: diff --git a/utils/vanilla_logger.py b/utils/vanilla_logger.py index bf1a57d..ba50148 100644 --- a/utils/vanilla_logger.py +++ b/utils/vanilla_logger.py @@ -1,4 +1,5 @@ import numpy as np +import logging class Logger(object): def __init__(self, log_dir, vanilla_logger, skip=False): @@ -7,6 +8,7 @@ class Logger(object): self.debug = vanilla_logger.debug self.warning = vanilla_logger.warning self.skip = skip + logging.info('') def scalar_summary(self, tag, value, step): if self.skip: