mirror of
https://github.com/wassname/ray.git
synced 2026-07-16 11:21:10 +08:00
Fix DeprecationWarning (#5608)
This commit is contained in:
@@ -91,7 +91,7 @@ class PyTorchTrainer(object):
|
||||
batch_size_per_replica = batch_size // num_replicas
|
||||
if batch_size % num_replicas > 0:
|
||||
new_batch_size = batch_size_per_replica * num_replicas
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
("Changing batch size from {old_batch_size} to "
|
||||
"{new_batch_size} to evenly distribute batches across "
|
||||
"{num_replicas} replicas.").format(
|
||||
|
||||
@@ -141,7 +141,7 @@ class MemoryMonitor(object):
|
||||
self.worker_name, round(heap_size / (1024**3), 4),
|
||||
round(self.heap_limit / (1024**3), 4)))
|
||||
elif heap_size > 0.8 * self.heap_limit:
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"Heap memory usage for {} is {} / {} GiB limit".format(
|
||||
self.worker_name, round(heap_size / (1024**3), 4),
|
||||
round(self.heap_limit / (1024**3), 4)))
|
||||
|
||||
@@ -84,7 +84,7 @@ def create(project_name, cluster_yaml, requirements):
|
||||
os.makedirs(PROJECT_DIR)
|
||||
|
||||
if cluster_yaml is None:
|
||||
logger.warn("Using default autoscaler yaml")
|
||||
logger.warning("Using default autoscaler yaml")
|
||||
|
||||
with open(CLUSTER_TEMPLATE) as f:
|
||||
template = f.read().replace(r"{{name}}", project_name)
|
||||
@@ -94,7 +94,7 @@ def create(project_name, cluster_yaml, requirements):
|
||||
cluster_yaml = CLUSTER_YAML
|
||||
|
||||
if requirements is None:
|
||||
logger.warn("Using default requirements.txt")
|
||||
logger.warning("Using default requirements.txt")
|
||||
# no templating required, just copy the file
|
||||
copyfile(REQUIREMENTS_TXT_TEMPLATE, REQUIREMENTS_TXT)
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ class RayTrialExecutor(TrialExecutor):
|
||||
if wait_time > NONTRIVIAL_WAIT_TIME_THRESHOLD_S:
|
||||
self._last_nontrivial_wait = time.time()
|
||||
if time.time() - self._last_nontrivial_wait > BOTTLENECK_WARN_PERIOD_S:
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"Over the last {} seconds, the Tune event loop has been "
|
||||
"backlogged processing new results. Consider increasing your "
|
||||
"period of result reporting to improve performance.".format(
|
||||
|
||||
@@ -26,8 +26,9 @@ class sample_from(object):
|
||||
|
||||
|
||||
def function(func):
|
||||
logger.warn("DeprecationWarning: wrapping {} with tune.function() is no "
|
||||
"longer needed".format(func))
|
||||
logger.warning(
|
||||
"DeprecationWarning: wrapping {} with tune.function() is no "
|
||||
"longer needed".format(func))
|
||||
return func
|
||||
|
||||
|
||||
|
||||
@@ -1794,7 +1794,7 @@ def listen_error_messages_raylet(worker, task_error_queue, threads_stopped):
|
||||
# Delay it a bit to see if we can suppress it
|
||||
task_error_queue.put((error_message, time.time()))
|
||||
else:
|
||||
logger.warn(error_message)
|
||||
logger.warning(error_message)
|
||||
except (OSError, redis.exceptions.ConnectionError) as e:
|
||||
logger.error("listen_error_messages_raylet: {}".format(e))
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user