Skip to content

shapely.errors.TopologicalError #152

@DongYifei0929

Description

@DongYifei0929

Thank you for the great work.
When I ran "python train.py --config-dir=. --config-name=image_pusht_diffusion_policy_cnn.yaml training.seed=42 training.device=cuda:0 hydra.run.dir='data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}${name}${task_name}'",
I encountered the error below after the first training epoch.

[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 220.39022562435579 235.97833701476938 at 220.39022562435579 235.97833701476938
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 261.16619173641607 306.04428358874611 at 261.16619173641607 306.04428358874611
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 178.67475743781893 209.88693535477299 at 178.67475743781893 209.88693535477299
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 289.14878950291342 266.5939992541135 at 289.14878950291342 266.5939992541135
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 234.99189481952544 314.67771107771085 at 234.99189481952544 314.67771107771085
[2025-10-12 04:52:44,956][shapely.geos][INFO] - Self-intersection at or near point 261.16619173641607 306.04428358874611
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 268.47390492719433 304.81559802469485 at 268.47390492719433 304.81559802469485
[2025-10-12 04:52:44,957][shapely.geos][INFO] - Self-intersection at or near point 220.39022562435579 235.97833701476938
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 309.8263772698329 215.10372685673218 at 309.8263772698329 215.10372685673218
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 291.18848680659426 277.83949209027594 at 291.18848680659426 277.83949209027594
[2025-10-12 04:52:44,955][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 210.5008311236281 342.48464083840656 at 210.5008311236281 342.48464083840656
[2025-10-12 04:52:44,957][shapely.geos][INFO] - Self-intersection at or near point 178.67475743781893 209.88693535477299
[2025-10-12 04:52:44,957][shapely.geos][INFO] - Self-intersection at or near point 289.14878950291342 266.5939992541135
[2025-10-12 04:52:44,957][shapely.geos][INFO] - Self-intersection at or near point 234.99189481952544 314.67771107771085
[2025-10-12 04:52:44,957][shapely.geos][INFO] - Self-intersection at or near point 268.47390492719433 304.81559802469485
[2025-10-12 04:52:44,958][shapely.geos][INFO] - Self-intersection at or near point 309.8263772698329 215.10372685673218
[2025-10-12 04:52:44,958][shapely.geos][INFO] - Self-intersection at or near point 291.18848680659426 277.83949209027594
[2025-10-12 04:52:44,958][shapely.geos][INFO] - Self-intersection at or near point 210.5008311236281 342.48464083840656
[2025-10-12 04:52:44,959][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 282.46518743654559 322.54902054743388 at 282.46518743654559 322.54902054743388
[2025-10-12 04:52:44,959][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 318.04646451990203 363.62674201727964 at 318.04646451990203 363.62674201727964
[2025-10-12 04:52:44,961][shapely.geos][INFO] - Self-intersection at or near point 318.04646451990203 363.62674201727964
[2025-10-12 04:52:44,961][shapely.geos][INFO] - Self-intersection at or near point 282.46518743654559 322.54902054743388
[2025-10-12 04:52:44,977][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 203.46956639340542 347.49655400550603 at 203.46956639340542 347.49655400550603
[2025-10-12 04:52:44,978][shapely.geos][INFO] - Self-intersection at or near point 203.46956639340542 347.49655400550603
[2025-10-12 04:52:44,985][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 228.68062339104259 244.17213369889146 at 228.68062339104259 244.17213369889146
[2025-10-12 04:52:44,985][shapely.geos][ERROR] - TopologyException: Input geom 1 is invalid: Self-intersection at or near point 297.62376437258138 216.36702689446531 at 297.62376437258138 216.36702689446531
[2025-10-12 04:52:44,986][shapely.geos][INFO] - Self-intersection at or near point 228.68062339104259 244.17213369889146
[2025-10-12 04:52:44,987][shapely.geos][INFO] - Self-intersection at or near point 297.62376437258138 216.36702689446531
ERROR: Received the following error from Worker-25: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b92ca0>
ERROR: Shutting down Worker-25.
ERROR: Received the following error from Worker-4: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b8f520>
ERROR: Shutting down Worker-4.
ERROR: Received the following error from Worker-24: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b93b80>
ERROR: Shutting down Worker-24.
ERROR: Received the following error from Worker-9: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b8fa60>
ERROR: Shutting down Worker-9.
ERROR: Received the following error from Worker-21: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b93820>
ERROR: Shutting down Worker-21.
ERROR: Received the following error from Worker-5: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b90640>
ERROR: Shutting down Worker-5.
ERROR: Received the following error from Worker-13: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b8dee0>
ERROR: Shutting down Worker-13.
ERROR: Received the following error from Worker-7: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b90820>
ERROR: Shutting down Worker-7.
ERROR: Received the following error from Worker-23: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b93be0>
ERROR: Shutting down Worker-23.
ERROR: Received the following error from Worker-38: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b97b80>
ERROR: Shutting down Worker-38.
ERROR: Received the following error from Worker-39: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b96ca0>
ERROR: Shutting down Worker-39.
ERROR: Received the following error from Worker-28: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b98be0>
ERROR: Shutting down Worker-28.
ERROR: Received the following error from Worker-52: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b9bbb0>
ERROR: Shutting down Worker-52.
ERROR: Received the following error from Worker-53: TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b9acd0>
ERROR: Shutting down Worker-53.
ERROR: Raising the last exception back to the main process.
Error executing job with overrides: ['training.seed=42', 'training.device=cuda:0']
Traceback (most recent call last):
File "/mnt/afs/dongyifei/diffusion_policy/train.py", line 32, in main
workspace.run()
File "/mnt/afs/dongyifei/diffusion_policy/diffusion_policy/workspace/train_diffusion_unet_hybrid_workspace.py", line 215, in run
runner_log = env_runner.run(policy)
File "/mnt/afs/dongyifei/diffusion_policy/diffusion_policy/env_runner/pusht_image_runner.py", line 208, in run
obs, reward, done, info = env.step(action)
File "/mnt/afs/dongyifei/miniconda3/envs/robodiff/lib/python3.9/site-packages/gym/vector/vector_env.py", line 94, in step
return self.step_wait()
File "/mnt/afs/dongyifei/diffusion_policy/diffusion_policy/gym_util/async_vector_env.py", line 291, in step_wait
self._raise_if_errors(successes)
File "/mnt/afs/dongyifei/diffusion_policy/diffusion_policy/gym_util/async_vector_env.py", line 401, in _raise_if_errors
raise exctype(value)
shapely.errors.TopologicalError: The operation 'GEOSIntersection_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.multipolygon.MultiPolygon object at 0x7f8e96b9acd0>

Does anyone have any idea about what's going on? Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions