Python 2 support

This commit is contained in:
allegroai 2019-07-01 22:23:40 +03:00
parent 8894981a19
commit 8475ecaed8
3 changed files with 10 additions and 6 deletions

View File

@ -191,7 +191,8 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
latest_version[0]), latest_version[0]),
) )
check_package_update_thread = Thread(target=check_package_update, daemon=True) check_package_update_thread = Thread(target=check_package_update)
check_package_update_thread.daemon = True
check_package_update_thread.start() check_package_update_thread.start()
result = ScriptInfo.get(log=self.log) result = ScriptInfo.get(log=self.log)
for msg in result.warning_messages: for msg in result.warning_messages:

View File

@ -33,7 +33,7 @@ from .utilities.args import argparser_parseargs_called, get_argparser_last_args,
from .binding.frameworks.pytorch_bind import PatchPyTorchModelIO from .binding.frameworks.pytorch_bind import PatchPyTorchModelIO
from .binding.frameworks.tensorflow_bind import PatchSummaryToEventTransformer, PatchTensorFlowEager, \ from .binding.frameworks.tensorflow_bind import PatchSummaryToEventTransformer, PatchTensorFlowEager, \
PatchKerasModelIO, PatchTensorflowModelIO PatchKerasModelIO, PatchTensorflowModelIO
# from .utilities.resource_monitor import ResourceMonitor from .utilities.resource_monitor import ResourceMonitor
from .binding.matplotlib_bind import PatchedMatplotlib from .binding.matplotlib_bind import PatchedMatplotlib
from .utilities.seed import make_deterministic from .utilities.seed import make_deterministic
@ -226,8 +226,8 @@ class Task(_Task):
PatchTensorflowModelIO.update_current_task(task) PatchTensorflowModelIO.update_current_task(task)
PatchPyTorchModelIO.update_current_task(task) PatchPyTorchModelIO.update_current_task(task)
if auto_resource_monitoring: if auto_resource_monitoring:
# task._resource_monitor = ResourceMonitor(task) task._resource_monitor = ResourceMonitor(task)
pass # task._resource_monitor.start() task._resource_monitor.start()
# Check if parse args already called. If so, sync task parameters with parser # Check if parse args already called. If so, sync task parameters with parser
if argparser_parseargs_called(): if argparser_parseargs_called():
parser, parsed_args = get_argparser_last_args() parser, parsed_args = get_argparser_last_args()
@ -417,7 +417,9 @@ class Task(_Task):
# make sure everything is in sync # make sure everything is in sync
task.reload() task.reload()
# make sure we see something in the UI # make sure we see something in the UI
threading.Thread(target=LoggerRoot.flush, daemon=True).start() thread = threading.Thread(target=LoggerRoot.flush)
thread.daemon = True
thread.start()
return task return task
@staticmethod @staticmethod

View File

@ -35,7 +35,8 @@ class ResourceMonitor(object):
def start(self): def start(self):
self._exit_event.clear() self._exit_event.clear()
self._thread = Thread(target=self._daemon, daemon=True) self._thread = Thread(target=self._daemon)
self._thread.daemon = True
self._thread.start() self._thread.start()
def stop(self): def stop(self):