mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 23:23:15 +08:00
Remove deprecation warnings when running actor tests (#3563)
* remove deprecation warnings when running actor tests * replacing logger.warn with logger.warning * Update worker.py * Update policy_client.py * Update compression.py
This commit is contained in:
committed by
Philipp Moritz
parent
fb33fa9097
commit
c4cba98c75
+3
-3
@@ -216,7 +216,7 @@ class ActorMethod(object):
|
||||
return self._remote(args, kwargs)
|
||||
|
||||
def _submit(self, args, kwargs, num_return_vals=None):
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"WARNING: _submit() is being deprecated. Please use _remote().")
|
||||
return self._remote(
|
||||
args=args, kwargs=kwargs, num_return_vals=num_return_vals)
|
||||
@@ -338,7 +338,7 @@ class ActorClass(object):
|
||||
num_cpus=None,
|
||||
num_gpus=None,
|
||||
resources=None):
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"WARNING: _submit() is being deprecated. Please use _remote().")
|
||||
return self._remote(
|
||||
args=args,
|
||||
@@ -679,7 +679,7 @@ class ActorHandle(object):
|
||||
# If the worker is a driver and driver id has changed because
|
||||
# Ray was shut down re-initialized, the actor is already cleaned up
|
||||
# and we don't need to send `__ray_terminate__` again.
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"Actor is garbage collected in the wrong driver." +
|
||||
" Actor id = %s, class name = %s.", self._ray_actor_id,
|
||||
self._ray_class_name)
|
||||
|
||||
@@ -69,7 +69,7 @@ class DistributedSGD(object):
|
||||
all_reduce_alg="simple"):
|
||||
|
||||
if num_workers == 1 and strategy == "ps":
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"The parameter server strategy does not make sense for single "
|
||||
"worker operation, falling back to simple mode.")
|
||||
strategy = "simple"
|
||||
|
||||
@@ -77,7 +77,7 @@ class RemoteFunction(object):
|
||||
num_cpus=None,
|
||||
num_gpus=None,
|
||||
resources=None):
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"WARNING: _submit() is being deprecated. Please use _remote().")
|
||||
return self._remote(
|
||||
args=args,
|
||||
|
||||
@@ -118,7 +118,7 @@ class PPOAgent(Agent):
|
||||
if waste_ratio > 1.5:
|
||||
raise ValueError(msg)
|
||||
else:
|
||||
logger.warn(msg)
|
||||
logger.warning(msg)
|
||||
if self.config["sgd_minibatch_size"] > self.config["train_batch_size"]:
|
||||
raise ValueError(
|
||||
"Minibatch size {} must be <= train batch size {}.".format(
|
||||
@@ -136,6 +136,6 @@ class PPOAgent(Agent):
|
||||
"simple_optimizer=True if this doesn't work for you.")
|
||||
if self.config["observation_filter"] != "NoFilter":
|
||||
# TODO(ekl): consider setting the default to be NoFilter
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"By default, observations will be normalized with {}".format(
|
||||
self.config["observation_filter"]))
|
||||
|
||||
@@ -53,7 +53,7 @@ def summarize_episodes(episodes, new_episodes, num_dropped):
|
||||
"""
|
||||
|
||||
if num_dropped > 0:
|
||||
logger.warn("WARNING: {} workers have NOT returned metrics".format(
|
||||
logger.warning("WARNING: {} workers have NOT returned metrics".format(
|
||||
num_dropped))
|
||||
|
||||
episode_rewards = []
|
||||
|
||||
@@ -300,7 +300,7 @@ class PolicyEvaluator(EvaluatorInterface):
|
||||
self.batch_mode))
|
||||
|
||||
if input_evaluation_method == "simulation":
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"Requested 'simulation' input evaluation method: "
|
||||
"will discard all sampler outputs and keep only metrics.")
|
||||
sample_async = True
|
||||
|
||||
@@ -311,7 +311,7 @@ def _process_observations(async_vector_env, policies, batch_builder_pool,
|
||||
if (not _large_batch_warned and
|
||||
episode.batch_builder.total() > max(1000, unroll_length * 10)):
|
||||
_large_batch_warned = True
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"More than {} observations for {} env steps ".format(
|
||||
episode.batch_builder.total(),
|
||||
episode.batch_builder.count) + "are buffered in "
|
||||
|
||||
@@ -42,7 +42,7 @@ class JsonReader(InputReader):
|
||||
if isinstance(inputs, six.string_types):
|
||||
if os.path.isdir(inputs):
|
||||
inputs = os.path.join(inputs, "*.json")
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"Treating input directory as glob pattern: {}".format(
|
||||
inputs))
|
||||
if urlparse(inputs).scheme:
|
||||
|
||||
@@ -15,9 +15,9 @@ try:
|
||||
import lz4.frame
|
||||
LZ4_ENABLED = True
|
||||
except ImportError:
|
||||
logger.warn("lz4 not available, disabling sample compression. "
|
||||
"This will significantly impact RLlib performance. "
|
||||
"To install lz4, run `pip install lz4`.")
|
||||
logger.warning("lz4 not available, disabling sample compression. "
|
||||
"This will significantly impact RLlib performance. "
|
||||
"To install lz4, run `pip install lz4`.")
|
||||
LZ4_ENABLED = False
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@ try:
|
||||
import requests # `requests` is not part of stdlib.
|
||||
except ImportError:
|
||||
requests = None
|
||||
logger.warn("Couldn't import `requests` library. Be sure to install it on"
|
||||
" the client side.")
|
||||
logger.warning(
|
||||
"Couldn't import `requests` library. Be sure to install it on"
|
||||
" the client side.")
|
||||
|
||||
|
||||
class PolicyClient(object):
|
||||
|
||||
@@ -227,7 +227,7 @@ def _is_resolved(v):
|
||||
|
||||
def _try_resolve(v):
|
||||
if isinstance(v, types.FunctionType):
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
"Deprecation warning: Function values are ambiguous in Tune "
|
||||
"configuations. Either wrap the function with "
|
||||
"`tune.function(func)` to specify a function literal, or "
|
||||
|
||||
@@ -1381,8 +1381,9 @@ def _init(address_info=None,
|
||||
driver_mode = SCRIPT_MODE
|
||||
|
||||
if redis_max_memory and collect_profiling_data:
|
||||
logger.warn("Profiling data cannot be LRU evicted, so it is disabled "
|
||||
"when redis_max_memory is set.")
|
||||
logger.warning(
|
||||
"Profiling data cannot be LRU evicted, so it is disabled "
|
||||
"when redis_max_memory is set.")
|
||||
collect_profiling_data = False
|
||||
|
||||
# Get addresses of existing services.
|
||||
@@ -1646,8 +1647,8 @@ def init(redis_address=None,
|
||||
# Add the use_raylet option for backwards compatibility.
|
||||
if use_raylet is not None:
|
||||
if use_raylet:
|
||||
logger.warn("WARNING: The use_raylet argument has been "
|
||||
"deprecated. Please remove it.")
|
||||
logger.warning("WARNING: The use_raylet argument has been "
|
||||
"deprecated. Please remove it.")
|
||||
else:
|
||||
raise DeprecationWarning("The use_raylet argument is deprecated. "
|
||||
"Please remove it.")
|
||||
|
||||
Reference in New Issue
Block a user