# The \`print\` in the \`compute\_action\` function of class \`PPOTorchPolicy\` have no output

**URL:** <https://discuss.ray.io/t/the-print-in-the-compute-action-function-of-class-ppotorchpolicy-have-no-output/21993>\
**Category:** RLlib\
**Created:** [March 9, 2025, 8:27am UTC](https://discuss.ray.io/t/the-print-in-the-compute-action-function-of-class-ppotorchpolicy-have-no-output/21993 "2025-03-09T08:27:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunmengyao321](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sunmengyao321/32/7756_2.png) [@sunmengyao321](https://discuss.ray.io/u/sunmengyao321)\
**Post date:** [March 9, 2025, 8:27am UTC](https://discuss.ray.io/t/the-print-in-the-compute-action-function-of-class-ppotorchpolicy-have-no-output/21993/1 "2025-03-09T08:27:56Z")

</div>

When conducting PPO training in MARL, I want to use the `print` function to check the information output by the `compute_action` method of `PPOTorchPolicy`. However, there is no output. Could you please tell me what the reason is?

Here is my code for starting the training:

```auto
ray.init(
    ignore_reinit_error=True,
    num_cpus=N_CPUS,
    num_gpus=1,
    object_store_memory=2_000_000_000, # 2 GB
    log_to_driver=True,
    logging_level="INFO"
)

# Run the training
tune.run(
    "PPO",
    config=config.to_dict(),
    stop={"training_iteration": 30}, # Adjust the number of iterations as needed
    log_to_file=True, # 让 Ray 记录 Worker 输出
)

# Shutdown Ray
ray.shutdown()

```

---

<div class="post-metadata">

**Author:** ![Zacks](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/zacks/32/7747_2.png) [@Zacks](https://discuss.ray.io/u/Zacks)\
**Post date:** [March 10, 2025, 1:47am UTC](https://discuss.ray.io/t/the-print-in-the-compute-action-function-of-class-ppotorchpolicy-have-no-output/21993/2 "2025-03-10T01:47:56Z")

</div>

You hid too much information, so it’d hard to check the problem.

---

<div class="post-metadata">

**Author:** ![Lars\_Simon\_Zehnder](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/lars_simon_zehnder/32/1185_2.png) [@Lars\_Simon\_Zehnder](https://discuss.ray.io/u/Lars_Simon_Zehnder)\
**Post date:** [March 11, 2025, 7:13pm UTC](https://discuss.ray.io/t/the-print-in-the-compute-action-function-of-class-ppotorchpolicy-have-no-output/21993/3 "2025-03-11T19:13:29Z")

</div>

Duplicate of [Problem of using an LLM during PPO training](https://discuss.ray.io/t/problem-of-using-an-llm-during-ppo-training/22021)

---

<div class="post-metadata">

**Author:** ![Lars\_Simon\_Zehnder](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/lars_simon_zehnder/32/1185_2.png) [@Lars\_Simon\_Zehnder](https://discuss.ray.io/u/Lars_Simon_Zehnder)\
**Post date:** [March 11, 2025, 7:13pm UTC](https://discuss.ray.io/t/the-print-in-the-compute-action-function-of-class-ppotorchpolicy-have-no-output/21993/4 "2025-03-11T19:13:36Z")

</div>


