diff --git a/libero/__init__.py b/libero/__init__.py new file mode 100644 index 000000000..436b9f26a --- /dev/null +++ b/libero/__init__.py @@ -0,0 +1,2 @@ +# LIBERO: Benchmarking Knowledge Transfer for Lifelong Robot Learning +__version__ = "0.1.0" \ No newline at end of file diff --git a/libero/libero/benchmark/__init__.py b/libero/libero/benchmark/__init__.py index 2b833d093..5734edbee 100644 --- a/libero/libero/benchmark/__init__.py +++ b/libero/libero/benchmark/__init__.py @@ -161,7 +161,7 @@ def get_task_init_states(self, i): self.tasks[i].problem_folder, self.tasks[i].init_states_file, ) - init_states = torch.load(init_states_path) + init_states = torch.load(init_states_path, weights_only=False) return init_states def set_task_embs(self, task_embs): diff --git a/libero/libero/utils/utils.py b/libero/libero/utils/utils.py index 1f5a990a8..18e5b7789 100644 --- a/libero/libero/utils/utils.py +++ b/libero/libero/utils/utils.py @@ -25,6 +25,9 @@ def postprocess_model_xml(xml_str, cameras_dict={}): path = os.path.split(robosuite.__file__)[0] path_split = path.split("/") + libero_path = os.path.split(__file__)[0] + libero_path_split = libero_path.split("/") + libero_path_split.pop() # remove 'utils' # replace mesh and texture file paths tree = ET.fromstring(xml_str) @@ -47,6 +50,21 @@ def postprocess_model_xml(xml_str, cameras_dict={}): new_path_split = path_split + old_path_split[ind + 1 :] new_path = "/".join(new_path_split) elem.set("file", new_path) + + # Correcting the libero asset paths + for elem in all_elements: + old_path = elem.get("file") + if old_path is None: + continue + old_path_split = old_path.split("/") + if "chiliocosm" not in old_path_split: + continue + ind = max( + loc for loc, val in enumerate(old_path_split) if val == "chiliocosm" + ) # last occurrence index + new_path_split = libero_path_split + old_path_split[ind + 1 :] + new_path = "/".join(new_path_split) + elem.set("file", new_path) # cameras = root.find("worldbody").findall("camera") cameras = find_elements(root=tree, tags="camera", return_first=False) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..ddca540cb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[project] +name = "libero" +version = "0.1.0" +description = "LIBERO: Benchmarking Knowledge Transfer for Lifelong Robot Learning" +readme = "README.md" +requires-python = ">=3.8" +authors = [ + { name = "Bo Liu", email = "bliu@cs.utexas.edu" }, + { name = "Yifeng Zhu", email = "yifengz@cs.utexas.edu" }, + { name = "Chongkai Gao" }, + { name = "Yihao Feng" }, + { name = "Qiang Liu" }, + { name = "Yuke Zhu" }, + { name = "Peter Stone" }, +] +dependencies = [ + "easydict", + "robomimic==0.2.0", + "robosuite==1.4.0", + "bddl==1.0.1", + "future==0.18.2", + "matplotlib", + "cloudpickle", + "gym==0.25.2", +] + +[project.scripts] +"lifelong.main" = "libero.lifelong.main:main" +"lifelong.eval" = "libero.lifelong.evaluate:main" +"libero.config_copy" = "scripts.config_copy:main" +"libero.create_template" = "scripts.create_template:main" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["libero"] \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 59d490046..000000000 --- a/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -# read the contents of your README file -from os import path - -from setuptools import find_packages, setup - -this_directory = path.abspath(path.dirname(__file__)) -with open(path.join(this_directory, "./README.md"), encoding="utf-8") as f: - lines = f.readlines() - -# remove images from README -lines = [x for x in lines if ".png" not in x] -long_description = "".join(lines) - -setup( - name="libero", - packages=[package for package in find_packages() if package.startswith("libero")], - install_requires=[], - eager_resources=["*"], - include_package_data=True, - python_requires=">=3", - description="LIBERO: Benchmarking Knowledge Transfer for Lifelong Robot Learning", - author="Bo Liu, Yifeng Zhu, Chongkai Gao, Yihao Feng, Qiang Liu, Yuke Zhu, Peter Stone", - # url="https://github.com/ARISE-Initiative/robosuite", - author_email="bliu@cs.utexas.edu, yifengz@cs.utexas.edu", - version="0.1.0", - long_description=long_description, - long_description_content_type="text/markdown", - entry_points={ - "console_scripts": [ - "lifelong.main=libero.lifelong.main:main", - "lifelong.eval=libero.lifelong.evaluate:main", - "libero.config_copy=scripts.config_copy:main", - "libero.create_template=scripts.create_template:main", - ] - }, -)