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

Error "Inconsistent coordinate dimensionality" #1781

Closed
xlnwel opened this issue Dec 22, 2022 · 6 comments
Closed

Error "Inconsistent coordinate dimensionality" #1781

xlnwel opened this issue Dec 22, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@xlnwel
Copy link

xlnwel commented Dec 22, 2022

BUG REPORT

High Level Description
Run into Error "Inconsistent coordinate dimensionality" when running the sanity check.

Related Post
#1773 (comment)

SMARTS version
0.7.0rc0

Steps to reproduce the bug
The error happens when running make sanity-test.

Resulting and expected behaviour
Should expect no errors.

Error logs and screenshots

image

System information

  • Operating system & Environment [Please note if using Docker]:
  • Number of system cores available
  • Python version [Please note if using Jupyter]
  • Python packages [e.g. from pip freeze]
  • SUMO version
  • Date when bug occurred

Impact [If known]

@xlnwel xlnwel added the bug Something isn't working label Dec 22, 2022
@Adaickalavan
Copy link
Member

Hi @xlnwel,

This issue is due to the recently released shapely==2.0.0 package. This issue was fixed by #1773 in our development branch and will be merged into the master branch in the next release.

There are two options now:

  1. Try using the unreleased development branch, i.e., $ git checkout develop
  2. If you are using the master branch or a release tag, please uninstall any existing shapely package and reinstall the older shapely==1.8.5 package.

@xlnwel
Copy link
Author

xlnwel commented Dec 23, 2022

Hello @Adaickalavan

I've tried both options, but either way, the following error happens when I run sanity check on the Apple M1 chip

Traceback (most recent call last):                                                                                                                                                                                                  [100/1508]
  File "<string>", line 1, in <module>
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/runpy.py", line 288, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/chenxw/Documents/SMARTS/scenarios/sumo/zoo_intersection/tmpfok519n0.py", line 62, in <module>
    gen_traffic(
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/genscenario.py", line 162, in gen_traffic
    saved_path = generator.plan_and_save(traffic, name, output_dir, seed=seed)
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/generators.py", line 188, in plan_and_save
    net_file=self.road_network.source,
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/generators.py", line 363, in road_network
    self._cache_road_network()
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/generators.py", line 297, in _cache_road_network
    self._road_network = SumoRoadNetwork.from_spec(map_spec)
  File "/Users/chenxw/Documents/SMARTS/smarts/core/sumo_road_network.py", line 180, in from_spec
    junction_check_proc.start()
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError:
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/runpy.py", line 288, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/chenxw/Documents/SMARTS/scenarios/sumo/zoo_intersection/tmpfok519n0.py", line 87, in <module>
    gen_social_agent_missions(
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/genscenario.py", line 214, in gen_social_agent_missions
    saved = _gen_missions(
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/genscenario.py", line 392, in _gen_missions
    missions = [
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/genscenario.py", line 393, in <listcomp>
    types._ActorAndMission(actor=actor, mission=resolve_mission(mission))
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/genscenario.py", line 374, in resolve_mission
    kwargs["route"] = generator.resolve_route(route, False)
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/generators.py", line 354, in resolve_route
    road_map = self._map_for_route(route)
  File "/Users/chenxw/Documents/SMARTS/smarts/sstudio/generators.py", line 324, in _map_for_route
    road_map, _ = map_spec.builder_fn(map_spec)
  File "/Users/chenxw/Documents/SMARTS/smarts/core/default_map_builder.py", line 148, in get_road_map
    road_map = map_class.from_spec(map_spec)
  File "/Users/chenxw/Documents/SMARTS/smarts/core/sumo_road_network.py", line 180, in from_spec
    junction_check_proc.start()
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError:
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
/opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/trimesh/curvature.py:12: DeprecationWarning: Please use `coo_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.coo` namespace is deprecated.
  from scipy.sparse.coo import coo_matrix
dyld[6594]: Library not loaded: /opt/homebrew/opt/gdal/lib/libgdal.31.dylib
  Referenced from: /opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/sumo/bin/netconvert
  Reason: tried: '/opt/homebrew/opt/gdal/lib/libgdal.31.dylib' (no such file), '/usr/local/lib/libgdal.31.dylib' (no such file), '/usr/lib/libgdal.31.dylib' (no such file)
WARNING:SumoRoadNetwork:unable to use netconvert tool to normalize coordinates: Command '['netconvert', '--offset.disable-normalization=FALSE', '--seed', '923909729', '-s', 'scenarios/sumo/zoo_intersection/map.net.xml', '-o', 'scenarios/sumo/zoo_intersection/shifted_map-AUTOGEN.net.xml']' returned non-zero exit status 250.
./tests/test_setup.py
PYTHONPATH=/Users/chenxw/Documents/SMARTS PYTHONHASHSEED=42 pytest -v \
                --doctest-modules \
                --forked \
                --dist=loadscope \
                --junitxml="sanity_test_result.xml" \
                -n `expr \( \`nproc\` \/ 2 \& \`nproc\` \> 3 \) \| 2` \
                ./smarts/core/tests/test_python_version.py::test_python_version \
                ./smarts/core/tests/test_sumo_version.py::test_sumo_version \
                ./smarts/core/tests/test_dynamics_backend.py::test_set_pose \
                ./smarts/core/tests/test_sensors.py::test_waypoints_sensor \
                ./smarts/core/tests/test_smarts.py::test_smarts_doesnt_leak_tasks_after_reset \
                ./examples/tests/test_examples.py::test_examples[multi_agent] \
                ./smarts/env/tests/test_social_agent.py::test_social_agents
/bin/sh: nproc: command not found
/bin/sh: nproc: command not found
expr: syntax error
/bin/sh: pytest: command not found
make: *** [sanity-test] Error 127

I further tried to run examples/multi_agent.py, and received the following error messages

/opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/trimesh/curvature.py:12: DeprecationWarning: Please use `coo_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.coo` namespace is deprecated.
  from scipy.sparse.coo import coo_matrix
/opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/trimesh/curvature.py:12: DeprecationWarning: Please use `coo_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.coo` namespace is deprecated.
  from scipy.sparse.coo import coo_matrix
/opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/trimesh/curvature.py:12: DeprecationWarning: Please use `coo_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.coo` namespace is deprecated.
  from scipy.sparse.coo import coo_matrix
Traceback (most recent call last):
  File "/Users/chenxw/Documents/SMARTS/examples/multi_agent.py", line 77, in <module>
    main(
  File "/Users/chenxw/Documents/SMARTS/examples/multi_agent.py", line 32, in main
    env = gym.make(
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/gym/envs/registration.py", line 145, in make
    return registry.make(id, **kwargs)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/gym/envs/registration.py", line 90, in make
    env = spec.make(**kwargs)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/site-packages/gym/envs/registration.py", line 60, in make
    env = cls(**_kwargs)
  File "/Users/chenxw/Documents/SMARTS/smarts/env/hiway_env.py", line 131, in __init__
    envision_client = Envision(
  File "/Users/chenxw/Documents/SMARTS/envision/client.py", line 152, in __init__
    self._process.start()
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/opt/anaconda3/envs/chenxw/lib/python3.9/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'EnvisionStateFilter.default.<locals>.default_override'

@Adaickalavan
Copy link
Member

Hi @xlnwel,

Consider pip installing the test option and try running sanity-test again. The commands are as follows.

$ cd <path/to>/SMARTS
$ python3.8 -m venv ./.venv
$ source ./.venv/bin/activate
$ pip install --upgrade pip wheel setuptools
$ pip install -e .[camera_obs,dev,test]
$ make sanity-test 

@xlnwel
Copy link
Author

xlnwel commented Dec 29, 2022

Hi @Adaickalavan Thank you so much for the help. I now able to run SMARTS on my local machine without issues

@xlnwel xlnwel closed this as completed Dec 29, 2022
@ggplz
Copy link

ggplz commented Oct 29, 2023

你好@Adaickalavan十分感谢你的帮助。我现在可以在本地计算机上运行 SMARTS,不会出现任何问题

/opt/anaconda3/envs/ggplz/bin/python /Users/heshouliang/smart/pymarl-master/src/SMARTS/examples/e3_multi_agent.py
Traceback (most recent call last):
File "/Users/heshouliang/smart/pymarl-master/src/SMARTS/examples/e3_multi_agent.py", line 85, in
main(
File "/Users/heshouliang/smart/pymarl-master/src/SMARTS/examples/e3_multi_agent.py", line 48, in main
env = gym.make(
File "/opt/anaconda3/envs/ggplz/lib/python3.8/site-packages/gymnasium/envs/registration.py", line 802, in make
env = env_creator(**env_spec_kwargs)
File "/Users/heshouliang/smart/pymarl-master/src/SMARTS/smarts/env/gymnasium/hiway_env_v1.py", line 158, in init
visualization_client = visualization_client_builder(
File "/Users/heshouliang/smart/pymarl-master/src/SMARTS/envision/client.py", line 153, in init
self._process.start()
File "/opt/anaconda3/envs/ggplz/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/opt/anaconda3/envs/ggplz/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/opt/anaconda3/envs/ggplz/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/opt/anaconda3/envs/ggplz/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/opt/anaconda3/envs/ggplz/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/opt/anaconda3/envs/ggplz/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/opt/anaconda3/envs/ggplz/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'EnvisionStateFilter.default..default_override'

我在运行官网多智能体的例子时也发生同样问题,请问如何解决?

@Adaickalavan
Copy link
Member

Hi @ggplz,

Given this issue had been previously closed by the original author, and the significant codebase changes since then, please consider opening a new issue for us to better clarify any concerns.

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

No branches or pull requests

3 participants