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

Update push_to_hub.py #24

Conversation

andrewtheiss
Copy link

Update to gym has altered gym.envs.registry to a dictionary. The change alters behavior on the initial huggingface.co Unit1 tutorial if not using Google CoLab.

Reproduce using WSL windows 10 ubuntu
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04

To Reproduce:
Follow tutorial on Unit1 as defined...

package_to_hub(model=model, model_name=model_name,model_architecture=model_architecture,env_id=env_id,eval_env=eval_env,repo_id=repo_id,commit_message=commit_message)
ℹ This function will save, evaluate, generate a video of your agent, create a model card and push everything to the hub. It might take up to 1min. This is a work in progress: if you encounter a bug, please open an issue. Traceback (most recent call last):
File "", line 1, in
File "/home/theiss/.local/lib/python3.10/site-packages/huggingface_sb3/push_to_hub.py", line 364, in package_to_hub
is_deterministic = not is_atari(env_id)
File "/home/theiss/.local/lib/python3.10/site-packages/huggingface_sb3/push_to_hub.py", line 104, in is_atari
entry_point = gym.envs.registry[env_id].entry_point
AttributeError: 'dict' object has no attribute 'env_specs'

Similar to issue mentioned:
File "/home/anavani/anaconda3/envs/rad/lib/python3.7/site-packages/dmc2gym/init.py", line 28, in make
if not env_id in gym.envs.registry.env_specs:
AttributeError: 'dict' object has no attribute 'env_specs'

openai/gym#3097

Update to gym has altered gym.envs.registry to a dictionary.  The change alters behavior on the initial huggingface.co Unit1 tutorial if not using Google CoLab.

Reproduce using WSL windows 10 ubuntu 
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04

To Reproduce:
Follow tutorial on Unit1 as defined...


>>> package_to_hub(model=model, model_name=model_name,model_architecture=model_architecture,env_id=env_id,eval_env=eval_env,repo_id=repo_id,commit_message=commit_message)
ℹ This function will save, evaluate, generate a video of your agent,
create a model card and push everything to the hub. It might take up to 1min.
This is a work in progress: if you encounter a bug, please open an issue.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/theiss/.local/lib/python3.10/site-packages/huggingface_sb3/push_to_hub.py", line 364, in package_to_hub
    is_deterministic = not is_atari(env_id)
  File "/home/theiss/.local/lib/python3.10/site-packages/huggingface_sb3/push_to_hub.py", line 104, in is_atari
    entry_point = gym.envs.registry[env_id].entry_point
AttributeError: 'dict' object has no attribute 'env_specs'
 



Similar to issue mentioned: 
File "/home/anavani/anaconda3/envs/rad/lib/python3.7/site-packages/dmc2gym/__init__.py", line 28, in make
   if not env_id in gym.envs.registry.env_specs:
AttributeError: 'dict' object has no attribute 'env_specs'

openai/gym#3097
@dsummersl
Copy link

Ran into this issue when using the unit1 tutorial - downgraded gym to v 0.23.1 for the time being to work around it.

@simoninithomas
Copy link
Member

Hey there 👋 closing the PR since we're updating the package to v2.3 with Gymnasium support 🤗

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

Successfully merging this pull request may close these issues.

3 participants