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

Why I can't find module "metadrive.constants"? #35

Closed
RuiqiZhang99 opened this issue Mar 10, 2023 · 3 comments
Closed

Why I can't find module "metadrive.constants"? #35

RuiqiZhang99 opened this issue Mar 10, 2023 · 3 comments
Assignees

Comments

@RuiqiZhang99
Copy link

Hello, Mr. Peng,
I run your official code with gym==0.19.0 and ray==0.22.0, and download metadrive with "git clone" commend.

However, there is an error:

Successfully registered the following environments: ['MetaDrive-validation-v0', 'MetaDrive-10env-v0', 'MetaDrive-100envs-v0', 'MetaDrive-1000envs-v0', 'SafeMetaDrive-validation-v0', 'SafeMetaDrive-10env-v0', 'SafeMetaDrive-100envs-v0', 'SafeMetaDrive-1000envs-v0', 'MARLTollgate-v0', 'MARLBottleneck-v0', 'MARLRoundabout-v0', 'MARLIntersection-v0', 'MARLParkingLot-v0', 'MARLMetaDrive-v0'].
Successfully initialize Ray!
Available resources:  {'object_store_memory': 8912057548.0, 'accelerator_type:G': 1.0, 'memory': 17824115099.0, 'node:192.168.1.104': 1.0, 'CPU': 96.0}
== Status ==
Current time: 2023-03-10 23:34:46 (running for 00:00:00.41)
Memory usage on this node: 9.2/31.0 GiB 
Using FIFO scheduling algorithm.
Resources requested: 1.9999999999999998/96 CPUs, 0/0 GPUs, 0.0/16.6 GiB heap, 0.0/8.3 GiB objects (0.0/1.0 accelerator_type:G)
Result logdir: /home/ps/Documents/Projects/CoPO/TEST
Number of trials: 5/5 (4 PENDING, 1 RUNNING)
+---------------------------------------------------+----------+-------+----------------------+--------+-----------------+
| Trial name                                        | status   | loc   | env                  |   seed |   vf_clip_param |
|---------------------------------------------------+----------+-------+----------------------+--------+-----------------|
| IPPOTrainer_MultiAgentIntersectionEnv_15c85_00000 | RUNNING  |       | MultiAgentInter_50d0 |      0 |              10 |
| IPPOTrainer_MultiAgentIntersectionEnv_15c85_00001 | PENDING  |       | MultiAgentInter_50d0 |      0 |              20 |
| IPPOTrainer_MultiAgentIntersectionEnv_15c85_00002 | PENDING  |       | MultiAgentInter_50d0 |      0 |              50 |
| IPPOTrainer_MultiAgentIntersectionEnv_15c85_00003 | PENDING  |       | MultiAgentInter_50d0 |      0 |             100 |
| IPPOTrainer_MultiAgentIntersectionEnv_15c85_00004 | PENDING  |       | MultiAgentInter_50d0 |      0 |            1000 |
+---------------------------------------------------+----------+-------+----------------------+--------+-----------------+


2023-03-10 23:34:50,656 ERROR trial_runner.py:1088 -- Trial IPPOTrainer_MultiAgentIntersectionEnv_15c85_00000: Error processing event.
ray.tune.error._TuneNoNextExecutorEventError: Traceback (most recent call last):
  File "/home/ps/miniconda3/envs/copo/lib/python3.7/site-packages/ray/tune/execution/ray_trial_executor.py", line 1070, in get_next_executor_event
    future_result = ray.get(ready_future)
  File "/home/ps/miniconda3/envs/copo/lib/python3.7/site-packages/ray/_private/client_mode_hook.py", line 105, in wrapper
    return func(*args, **kwargs)
  File "/home/ps/miniconda3/envs/copo/lib/python3.7/site-packages/ray/_private/worker.py", line 2311, in get
    raise value
ray.exceptions.RayActorError: The actor died because of an error raised in its creation task, ray::IPPOTrainer.__init__() (pid=12557, ip=192.168.1.104, repr=IPPOTrainer)
  File "/home/ps/miniconda3/envs/copo/lib/python3.7/site-packages/ray/rllib/algorithms/algorithm.py", line 368, in __init__
    config.validate()
  File "/home/ps/Documents/Projects/CoPO/copo_code/copo/torch_copo/algo_ippo.py", line 50, in validate
    from metadrive.constants import DEFAULT_AGENT
ModuleNotFoundError: No module named 'metadrive.constants'

Hope you can help me to solve this issue, sincerely thanks :)

@RuiqiZhang99 RuiqiZhang99 changed the title Why I can'f find module "metadrive.constants"? Why I can't find module "metadrive.constants"? Mar 10, 2023
@pengzhenghao pengzhenghao self-assigned this Mar 14, 2023
@pengzhenghao
Copy link
Member

Do you install metadrive via

pip install -e .

?

@RuiqiZhang99
Copy link
Author

Do you install metadrive via

pip install -e .

?

Thanks for your respond. It is a stupid bug generated from IDE workspace.
Just fixed it by opening the code dir "./copo/copo_code/copo" rather than "./copo"

@pengzhenghao
Copy link
Member

Oh that's quite common. Happy to see you 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