cyang-kth / fmm

Fast map matching, an open source framework in C++
https://fmm-wiki.github.io/
Apache License 2.0
878 stars 205 forks source link

TypeError: can't pickle SwigPyObject objects #194

Closed mchl0203 closed 3 years ago

mchl0203 commented 3 years ago

If I use python multiprocessing to run STMATCH, it will get an error: TypeError: can't pickle SwigPyObject objects. Does anyone encounter this problem, and how to deal with it?

cyang-kth commented 3 years ago

The python binding is created using swig, which may not work with multiprocessing in Python.

To run parallelly, try with the option use_omp=True

status = fmm_model.match_gps_file(input_config, result_config, fmm_config, use_omp = True)
print status

https://github.com/cyang-kth/fmm/blob/6b43a16ea2b78cbbb03d79eb9fc7a45c4732a8fa/example/osmnx_example/map_matching.ipynb