Git Product home page Git Product logo

Comments (3)

sepilqi avatar sepilqi commented on May 18, 2024
In [252]: checkpoint = trainer.save()
     ...: print(checkpoint)
     ...:
     ...: evaluation = trainer.evaluate(checkpoint)
     ...: print(pretty_print(evaluation))
     ...:
     ...: restored_trainer = DQNTrainer(env=GymEnvironment)
     ...: restored_trainer.restore(checkpoint)
/root/ray_results/DQN_GymEnvironment_2022-10-25_10-50-33_uvb3xkn/checkpoint_000010
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [252], in <cell line: 4>()
      1 checkpoint = trainer.save()
      2 print(checkpoint)
----> 4 evaluation = trainer.evaluate(checkpoint)
      5 print(pretty_print(evaluation))
      7 restored_trainer = DQNTrainer(env=GymEnvironment)

File ~/.cache/pypoetry/virtualenvs/ray-KeD1w6JO-py3.9/lib/python3.9/site-packages/ray/rllib/algorithms/algorithm.py:775, in Algorithm.evaluate(self, duration_fn)
    770 else:
    771     if (
    772         self.evaluation_workers is None
    773         and self.workers.local_worker().input_reader is None
    774     ):
--> 775         raise ValueError(
    776             "Cannot evaluate w/o an evaluation worker set in "
    777             "the Trainer or w/o an env on the local worker!\n"
    778             "Try one of the following:\n1) Set "
    779             "`evaluation_interval` >= 0 to force creating a "
    780             "separate evaluation worker set.\n2) Set "
    781             "`create_env_on_driver=True` to force the local "
    782             "(non-eval) worker to have an environment to "
    783             "evaluate on."
    784         )
    786     # How many episodes/timesteps do we need to run?
    787     # In "auto" mode (only for parallel eval + training): Run as long
    788     # as training lasts.
    789     unit = self.config["evaluation_duration_unit"]

Input In [252], in <cell line: 4>()
      1 checkpoint = trainer.save()
      2 print(checkpoint)
----> 4 evaluation = trainer.evaluate(checkpoint)
      5 print(pretty_print(evaluation))
      7 restored_trainer = DQNTrainer(env=GymEnvironment)

File ~/.cache/pypoetry/virtualenvs/ray-KeD1w6JO-py3.9/lib/python3.9/site-packages/ray/rllib/algorithms/algorithm.py:775, in Algorithm.evaluate(self, duration_fn)
    770 else:
    771     if (
    772         self.evaluation_workers is None
    773         and self.workers.local_worker().input_reader is None
    774     ):
--> 775         raise ValueError(
    776             "Cannot evaluate w/o an evaluation worker set in "
    777             "the Trainer or w/o an env on the local worker!\n"
    778             "Try one of the following:\n1) Set "
    779             "`evaluation_interval` >= 0 to force creating a "
    780             "separate evaluation worker set.\n2) Set "
    781             "`create_env_on_driver=True` to force the local "
    782             "(non-eval) worker to have an environment to "
    783             "evaluate on."
    784         )
    786     # How many episodes/timesteps do we need to run?
    787     # In "auto" mode (only for parallel eval + training): Run as long
    788     # as training lasts.
    789     unit = self.config["evaluation_duration_unit"]

ValueError: Cannot evaluate w/o an evaluation worker set in the Trainer or w/o an env on the local worker!
Try one of the following:
1) Set `evaluation_interval` >= 0 to force creating a separate evaluation worker set.
2) Set `create_env_on_driver=True` to force the local (non-eval) worker to have an environment to evaluate on.

from learning_ray.

maxpumperla avatar maxpumperla commented on May 18, 2024

I think we've fixed this now, thanks for the issue!

from learning_ray.

maxpumperla avatar maxpumperla commented on May 18, 2024

(the API call in this example was wrong in any case... you just evaluate, no need to specify a checkpoint)

from learning_ray.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.