osmcode / pyosmium

Python bindings for libosmium
https://osmcode.org/pyosmium
BSD 2-Clause "Simplified" License
318 stars 65 forks source link

RuntimeError: Node callback keeps reference to OSM object. This is not allowed. #172

Closed jiawlu closed 3 years ago

jiawlu commented 3 years ago

pyosmium runs pretty well on my local windows and Linux machines, but I met the RuntimeError when I use it on Google colab. I have shared the code link below

https://colab.research.google.com/drive/18812oz3bs-efdC57_Nq3NGllkGw5Ewtb?usp=sharing

joto commented 3 years ago

This is explained in the docs: https://docs.osmcode.org/pyosmium/latest/troubleshooting.html#runtimeerror-callback-keeps-reference-to-osm-object

jiawlu commented 3 years ago

This is explained in the docs: https://docs.osmcode.org/pyosmium/latest/troubleshooting.html#runtimeerror-callback-keeps-reference-to-osm-object

@joto I am surprised that you closed the issue without having a try the code I provide. I was using a clean environment in Colab, and the thing is the code runs well on my local computers. Finally, I have figured it out. The reason is computers used in Colab is a little bit slow. Sometimes, the pointer for the last node has not been fully destroyed when a new one is being created, which will result in the error I reported. Hope that is helpful to you.