Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning #4

Open
SnehilJalan opened this issue Jan 26, 2024 · 0 comments
Open

DeprecationWarning #4

SnehilJalan opened this issue Jan 26, 2024 · 0 comments

Comments

@SnehilJalan
Copy link

Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
2024-01-26 18:46:32,146 INFO tune.py:220 -- Initializing Ray automatically. For cluster usage or custom Ray initialization, call ray.init(...) before tune.run(...).
2024-01-26 18:46:32,149 INFO tune.py:592 -- [output] This will use the new output engine with verbosity 2. To disable the new output and use the legacy output engine, set the environment variable RAY_AIR_NEW_OUTPUT=0. For more information, please see ray-project/ray#36949
Traceback (most recent call last):
File "src/models/train_model.py", line 124, in
main(args)
File "src/models/train_model.py", line 100, in main
result = tune.run(
File "/home/snehil/.local/lib/python3.8/site-packages/ray/tune/tune.py", line 620, in run
os.environ["RAY_AIR_LOCAL_CACHE_DIR"] = local_dir
File "/usr/lib/python3.8/os.py", line 680, in setitem
value = self.encodevalue(value)
File "/usr/lib/python3.8/os.py", line 750, in encode
raise TypeError("str expected, not %s" % type(value).name)
TypeError: str expected, not PosixPath
snehil@snehil-VirtualBox:~/Downloads/ifcnet-models-master$ python3 src/models/train_model.py MVCNN
2024-01-26 18:57:01,787 INFO worker.py:1715 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
2024-01-26 18:57:02,406 INFO tune.py:220 -- Initializing Ray automatically. For cluster usage or custom Ray initialization, call ray.init(...) before tune.run(...).
2024-01-26 18:57:02,408 INFO tune.py:592 -- [output] This will use the new output engine with verbosity 2. To disable the new output and use the legacy output engine, set the environment variable RAY_AIR_NEW_OUTPUT=0. For more information, please see ray-project/ray#36949
Traceback (most recent call last):
File "src/models/train_model.py", line 124, in
main(args)
File "src/models/train_model.py", line 100, in main
result = tune.run(
File "/home/snehil/.local/lib/python3.8/site-packages/ray/tune/tune.py", line 772, in run
experiments[i] = Experiment(
File "/home/snehil/.local/lib/python3.8/site-packages/ray/tune/experiment/experiment.py", line 149, in init
self._run_identifier = Experiment.register_if_needed(run)
File "/home/snehil/.local/lib/python3.8/site-packages/ray/tune/experiment/experiment.py", line 345, in register_if_needed
register_trainable(name, run_object)
File "/home/snehil/.local/lib/python3.8/site-packages/ray/tune/registry.py", line 105, in register_trainable
trainable = wrap_function(trainable, warn=warn)
File "/home/snehil/.local/lib/python3.8/site-packages/ray/tune/trainable/function_trainable.py", line 287, in wrap_function
raise DeprecationWarning(_CHECKPOINT_DIR_ARG_DEPRECATION_MSG)
DeprecationWarning: Accepting a checkpoint_dir argument in your training function is deprecated.
Please use ray.train.get_checkpoint() to access your checkpoint as a
ray.train.Checkpoint object instead. See below for an example:

Before

from ray import tune

def train_fn(config, checkpoint_dir=None):
if checkpoint_dir:
torch.load(os.path.join(checkpoint_dir, "checkpoint.pt"))
...

tuner = tune.Tuner(train_fn)
tuner.fit()

After

from ray import train, tune

def train_fn(config):
checkpoint: train.Checkpoint = train.get_checkpoint()
if checkpoint:
with checkpoint.as_directory() as checkpoint_dir:
torch.load(os.path.join(checkpoint_dir, "checkpoint.pt"))
...

tuner = tune.Tuner(train_fn)
tuner.fit()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant