Skip to content
Back to search

Plan4MC

[NeurIPS 2023 FMDM Workshop] Skill Reinforcement Learning and Planning for Open-World Long-Horizon Tasks

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/pku-rl--plan4mc/badge.svg)](/listings/pku-rl--plan4mc)

HTML

<a href="/listings/pku-rl--plan4mc"><img src="/api/listings/pku-rl--plan4mc/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

- Install MineDojo environment following the [official document](https://docs.minedojo.org/sections/getting_started/install.html#prerequisites). It requires python >= 3.9. We install jdk 1.8.0_171.

- Upgrade the MineDojo package: - Delete the original package `pip uninstall minedojo`. - Download our [modified MineDojo](https://github.com/PKU-RL/MCEnv). Run `python setup.py install`. - To this end, you can successfully run `validate_install.py` [here](https://github.com/MineDojo/MineDojo/tree/main/scripts).

- Install python packages in `requirements.txt`. Note that we require PyTorch>=1.8.1 and x-transformers==0.27.1.

- Download the [pretrained MineCLIP model](https://disk.pku.edu.cn/link/AA172254066B974E1D8AF772CADF55697B) named `attn.pth`. Move the file to `mineclip_official/`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 69 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Plan4MC: Skill Reinforcement Learning and Planning for Open-World Minecraft Tasks
  2. <div align="center">
  3. [[Website]](https://sites.google.com/view/plan4mc)
  4. [[Arxiv Paper]](https://arxiv.org/abs/2303.16563)
  5. [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/MineDojo)](https://pypi.org/project/MineDojo/)
  6. [<img src="https://img.shields.io/badge/Framework-PyTorch-red.svg"/>](https://pytorch.org/)
  7. [![GitHub license](https://img.shields.io/github/license/MineDojo/MineCLIP)](https://github.com/PKU-RL/Plan4MC/blob/main/LICENSE)
  8. ______________________________________________________________________
  9. ![](figs/plan4mc.png)
  10. </div>
  11. Plan4MC is a multi-task agent in Minecraft, solving long-term tasks via planning over basic skills. It acquire three types of fine-grained basic skills through reinforcement learning without demonstrations. With a skill graph pre-generated by the Large Language Model, the skill search algorithm generates skill plans and interactively selects policies to solve complicated tasks. Plan4MC accomplishes 24 diverse hard tasks in Minecraft.
  12. ## Installation
  13. - Install MineDojo environment following the [official document](https://docs.minedojo.org/sections/getting_started/install.html#prerequisites). It requires python >= 3.9. We install jdk 1.8.0_171.
  14. - Upgrade the MineDojo package:
  15. - Delete the original package `pip uninstall minedojo`.
  16. - Download our [modified MineDojo](https://github.com/PKU-RL/MCEnv). Run `python setup.py install`.
  17. - To this end, you can successfully run `validate_install.py` [here](https://github.com/MineDojo/MineDojo/tree/main/scripts).
  18. - Install python packages in `requirements.txt`. Note that we require PyTorch>=1.8.1 and x-transformers==0.27.1.
  19. - Download the [pretrained MineCLIP model](https://disk.pku.edu.cn/link/AA172254066B974E1D8AF772CADF55697B) named `attn.pth`. Move the file to `mineclip_official/`.
  20. ## Tasks
  21. - We provide 24 diverse tasks configured in `envs/hard_task_conf.yaml`. To create an environment for a task:
  22. ```python
  23. from envs.minecraft_hard_task import MinecraftHardHarvestEnv
  24. from minedojo.sim import InventoryItem
  25. import utils
  26. task_name = 'harvest_mutton_with_diamond_sword'
  27. task_conf = utils.get_yaml_data('envs/hard_task_conf.yaml')[task_name]
  28. init_items = {}
  29. if 'initial_inventory' in task_conf:
  30. init_items = task_conf['initial_inventory']
  31. init_inv = [InventoryItem(slot=i, name=k, variant=None, quantity=task_conf['initial_inventory'][k]) for i,k in enumerate(list(task_conf['initial_inventory'].keys()))]
  32. task_conf['initial_inventory'] = init_inv
  33. env = MinecraftHardHarvestEnv(image_size=(160,256), **task_conf)
  34. ```
  35. - To generate task names, initial plans and involved skills for all the tasks, run `python plan_all_tasks.py`.
  36. ## Plan4MC
  37. - Pre-trained models for skills are released in `skills/models/`.
  38. - To test Plan4MC on the task 'get_furnace_nearby_with_logs' as an example, run `python test.py --task get_furnace_nearby_with_logs`. Arguments:
  39. \-\-task: available tasks are listed in `envs/hard_task_conf.yaml`.
  40. \-\-save-path: output directory for testing results.
  41. \-\-test-episode: number of testing episodes.
  42. \-\-save-gif: set to 1 to save testing videos.
  43. ## Citation
  44. ```bibtex
  45. @article{yuan2023plan4mc,
  46. title={{Plan4MC}: Skill Reinforcement Learning and Planning for Open-World {Minecraft} Tasks},
  47. author={Yuan, Haoqi and Zhang, Chi and Wang, Hongcheng and Xie, Feiyang and Cai, Penglin and Dong, Hao and Lu, Zongqing},
  48. journal={arXiv preprint arXiv:2303.16563},
  49. year={2023},
  50. }
  51. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.