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

ImportError in load_ckpt.py due to missing attribute 'path' in 'importlib_resources' #15

Open
shure-dev opened this issue Dec 8, 2023 · 2 comments

Comments

@shure-dev
Copy link

Description:

(MineCLIP2) bash-3.2$ python3 MineCLIP/main/mineclip/load_ckpt.py variant=attn ckpt.path=/path/to/attn.pth

Traceback (most recent call last):
  File "/path/to/MineCLIP2/MineCLIP/main/mineclip/load_ckpt.py", line 5, in <module>
    from mineclip import MineCLIP
  File "/path/to/MineCLIP2/MineCLIP/mineclip/__init__.py", line 2, in <module>
    from .dense_reward import (
  File "/path/to/MineCLIP2/MineCLIP/mineclip/dense_reward/__init__.py", line 1, in <module>
    from .animal_zoo import AnimalZooDenseRewardWrapper, HuntCowDenseRewardEnv
  File "/path/to/MineCLIP2/MineCLIP/mineclip/dense_reward/animal_zoo/__init__.py", line 2, in <module>
    from .hunt_cow import HuntCowDenseRewardEnv
  File "/path/to/MineCLIP2/MineCLIP/mineclip/dense_reward/animal_zoo/hunt_cow.py", line 4, in <module>
    import minedojo
  File "/path/to/.local/share/virtualenvs/MineCLIP2-WRt4Br1D/lib/python3.9/site-packages/minedojo/__init__.py", line 1, in <module>
    from .tasks import make
  File "/path/to/.local/share/virtualenvs/MineCLIP2-WRt4Br1D/lib/python3.9/site-packages/minedojo/tasks/__init__.py", line 83, in <module>
    _ALL_TASKS_SPECS_UNFILLED = OmegaConf.load(_resource_file_path("tasks_specs.yaml"))
  File "/path/to/.local/share/virtualenvs/MineCLIP2-WRt4Br1D/lib/python3.9/site-packages/minedojo/tasks/__init__.py", line 29, in _resource_file_path
    with importlib_resources.path("minedojo.tasks.description_files", fname) as p:
AttributeError: module 'importlib_resources' has no attribute 'path'

Issue Overview:
The script load_ckpt.py is encountering an AttributeError due to the absence of the 'path' attribute in the 'importlib_resources' module. The error occurs in the minedojo module when attempting to load a resource file. This issue is hindering the execution of the script and needs to be addressed.

Steps to Reproduce:

  1. Run the command: python3 MineCLIP/main/mineclip/load_ckpt.py variant=attn ckpt.path=/path/to/attn.pth
  2. Observe the traceback and the AttributeError related to 'importlib_resources.path'.

Expected Behavior:
The script should execute without encountering the mentioned AttributeError, and the resource file should be loaded successfully.

@shure-dev
Copy link
Author

shure-dev commented Dec 8, 2023

MineDojo/MineDojo#106

I hope this merge is completed.

@AsWali
Copy link

AsWali commented Feb 5, 2024

In the mean time pip install importlib-resources==5.12 should fix it

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

2 participants