mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.37k stars 857 forks source link

TypeError: an integer is required (got type bytes) #571

Closed 0kam closed 4 years ago

0kam commented 4 years ago

Dear developers.

I'm new to this work. I've just build Opensfm successfully, and when I try to run bin/opensfm_run_all data/berlin, I got errors as the title shows. Here is the python traceback. $ bin/opensfm_run_all data/berlin

Running using Python command: python3 Traceback (most recent call last): File "/home/xxxxx/OpenSfM/bin/opensfm", line 10, in from opensfm import commands File "/home/xxxxx/OpenSfM/opensfm/commands/init.py", line 2, in from . import extract_metadata File "/home/xxxxx/OpenSfM/opensfm/commands/extract_metadata.py", line 5, in from opensfm import dataset File "/home/xxxxx/OpenSfM/opensfm/dataset.py", line 12, in from opensfm import io File "/home/xxxxx/OpenSfM/opensfm/io.py", line 20, in from opensfm import features File "/home/xxxxx/OpenSfM/opensfm/features.py", line 9, in from opensfm import context File "/home/xxxxx/OpenSfM/opensfm/context.py", line 8, in from joblib import Parallel, parallel_backend, delayed File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/init.py", line 119, in from .parallel import Parallel File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/parallel.py", line 28, in from ._parallel_backends import (FallbackToBackend, MultiprocessingBackend, File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/_parallel_backends.py", line 22, in from .executor import get_memmapping_executor File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/executor.py", line 14, in from .externals.loky.reusable_executor import get_reusable_executor File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/externals/loky/init.py", line 12, in from .backend.reduction import set_loky_pickler File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/externals/loky/backend/reduction.py", line 125, in from joblib.externals import cloudpickle # noqa: F401 File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/externals/cloudpickle/init.py", line 3, in from .cloudpickle import * File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/externals/cloudpickle/cloudpickle.py", line 152, in _cell_set_template_code = _make_cell_set_template_code() File "/home/xxxxx/.local/lib/python3.8/site-packages/joblib/externals/cloudpickle/cloudpickle.py", line 133, in _make_cell_set_template_code return types.CodeType( TypeError: an integer is required (got type bytes)

Below is my environment.

$ pip list Package Version
altgraph 0.17
cloudpickle 0.4.0
decorator 4.4.2
ExifRead 2.1.2
gpxpy 1.1.2
joblib 0.13.2 loky 1.2.1
networkx 1.11
numpy 1.18.2 Pillow 6.2.0
pip 20.0.2 py 1.8.1
PyInstaller 3.6
pyproj 1.9.5.1 pytest 3.0.7
python-dateutil 2.6.0
PyYAML 5.1
repoze.lru 0.7
scipy 1.4.1
setuptools 46.1.3 six 1.14.0 wheel 0.34.2 xmltodict 0.10.2

Do you have any ideas? Best.

paulinus commented 4 years ago

Thanks for reporting, @0kam. I do not know what is going on there. Looks like something is going on inside joblib. Two things to look at:

  1. You say that you are using python 3.6 but, from the backtrace, it looks like joblib is taken from a python 3.8 installation. No idea if that is an issue or not.

  2. You can try setting processes: 1 in the data/berlin/config.yaml file to avoid using joblib entirely to see if the problem is with joblib itself or some subprocess.

0kam commented 4 years ago

Thanks for helping @paulinus! That was my fault. My system uses python3.8 as a default, however, I forced Opensfm to use python3.6. The specified versions of pyproj and joblib in requirements.txt are not available with python3.8. When I changed using python3.6 to python3.8 and install the latest version of those two libraries, the example worked fine! Thanks again.