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

ModuleNotFoundError: No module named 'ding' #535

Closed
Tracked by #548
liuqi8827 opened this issue Nov 2, 2022 · 9 comments
Closed
Tracked by #548

ModuleNotFoundError: No module named 'ding' #535

liuqi8827 opened this issue Nov 2, 2022 · 9 comments
Labels
bug Something isn't working config Update config

Comments

@liuqi8827
Copy link

Hi,

I installed DI-engine succesfully.

However, when I run:

  1. cd /home/xx/DI-engine/dizoo/classic_control/pendulum/entry
  2. python3 -u pendulum_d4pg_main.py
    I got the error:
    Traceback (most recent call last):
    File "pendulum_d4pg_main.py", line 5, in
    from ding.config import compile_config
    ModuleNotFoundError: No module named 'ding'

Can you give me some suggestions?

@liuqi8827
Copy link
Author

I can run python3 -u pendulum_d4pg_main.py succesfully.
However:

  1. cd /home/lq/DI-engine/dizoo/mujoco/entry
  2. python3 -u mujoco_d4pg_main.py

I got the error:

Traceback (most recent call last):
  File "mujoco_d4pg_main.py", line 67, in <module>
    main(hopper_d4pg_config)
  File "mujoco_d4pg_main.py", line 31, in main
    env_fn=[lambda: MujocoEnv(cfg.env) for _ in range(collector_env_num)], cfg=cfg.env.manager
  File "/home/lq/DI-engine/ding/envs/env_manager/base_env_manager.py", line 109, in __init__
    self._env_ref = self._env_fn[0]()
  File "mujoco_d4pg_main.py", line 31, in <lambda>
    env_fn=[lambda: MujocoEnv(cfg.env) for _ in range(collector_env_num)], cfg=cfg.env.manager
  File "/home/lq/DI-engine/dizoo/mujoco/envs/mujoco_env.py", line 36, in __init__
    self._action_clip = cfg.action_clip
AttributeError: 'EasyDict' object has no attribute 'action_clip'

Can you give me some suggestions?

@PaParaZz1 PaParaZz1 added bug Something isn't working config Update config labels Nov 2, 2022
@PaParaZz1
Copy link
Member

It is the compatibility bug about version updates. You can add corresponding config field in hopper_d4pg_config.py to solve this problem as follows:

env = dict(
  ...,
  action_clip=False,
  ...,
)

@TuTuHuss
Copy link
Member

TuTuHuss commented Nov 3, 2022

btw, you may encounter the same problem in delay_reward_step replay_path save_replay_gif replay_path_gif, you can also solve these problem in the same way as @PaParaZz1‘s comment above.

@liuqi8827
Copy link
Author

It runs successfully.
Thanks a lot!

@chuaning
Copy link

Hello,
I want to ask that when something runs like this:
image
is it the same reason and the same answer?

@PaParaZz1
Copy link
Member

Hello, I want to ask that when something runs like this: image is it the same reason and the same answer?

Maybe not. How do you install DI-engine? You can provide more details and we will offer further support.

@PaParaZz1 PaParaZz1 reopened this Jan 25, 2024
@chuaning
Copy link

Hello, I want to ask that when something runs like this: image is it the same reason and the same answer?

Maybe not. How do you install DI-engine? You can provide more details and we will offer further support.

是这样的,我在pycharm的终端(conda虚拟环境)用git clone把DI-engine下载到我的默认项目文件夹里,但是运行的时候找不到ding是什么,出现的错误是这样的:
Traceback (most recent call last):
File "D:\pythonProject\pythonProject1\DI-engine\dizoo\gym_hybrid\config\gym_hybrid_hppo_config.py", line 63, in
from ding.entry import serial_pipeline_onpolicy
ModuleNotFoundError: No module named 'ding'

@PaParaZz1
Copy link
Member

Hello, I want to ask that when something runs like this: image is it the same reason and the same answer?

Maybe not. How do you install DI-engine? You can provide more details and we will offer further support.

是这样的,我在pycharm的终端(conda虚拟环境)用git clone把DI-engine下载到我的默认项目文件夹里,但是运行的时候找不到ding是什么,出现的错误是这样的: Traceback (most recent call last): File "D:\pythonProject\pythonProject1\DI-engine\dizoo\gym_hybrid\config\gym_hybrid_hppo_config.py", line 63, in from ding.entry import serial_pipeline_onpolicy ModuleNotFoundError: No module named 'ding'

Did you install DI-engine with the command like cd DI-engine && pip3 install -e .? If not, you can try this command and describe the way you did before.

@chuaning
Copy link

chuaning commented Feb 3, 2024

Thank you for your advice!
image
I forget whether used it or not, but the command goes well now like the image tells, but the ding still can't be recognized. And my path is as the second image you can see:
image
Also, the project files look like this:
image
Do I need to reload the DI-engine through pip3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config Update config
Projects
None yet
Development

No branches or pull requests

4 participants