-
Notifications
You must be signed in to change notification settings - Fork 601
Open
Labels
type: bugSomething isn't workingSomething isn't working
Description
Bug description
I started training ocr model with doctr, installed doctr by instruction in doctr repo, started training and get:
Code snippet to reproduce the bug
python references/recognition/train.py crnn_vgg16_bn --train_path /content/data --epochs 1
Error traceback
Traceback (most recent call last):
File "/content/doctr/doctr/datasets/generator/base.py", line 124, in __init__
_ = get_font(font, 10)
^^^^^^^^^^^^^^^^^^
File "/content/doctr/doctr/utils/fonts.py", line 36, in get_font
font = ImageFont.truetype(font_family, font_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/PIL/ImageFont.py", line 880, in truetype
return freetype(font)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/PIL/ImageFont.py", line 877, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/PIL/ImageFont.py", line 285, in __init__
self.font = core.getfont(
^^^^^^^^^^^^^
OSError: unknown file format
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/content/doctr/references/recognition/train.py", line 726, in <module>
main(args)
File "/content/doctr/references/recognition/train.py", line 281, in main
val_set = WordGenerator(
^^^^^^^^^^^^^^
File "/content/doctr/doctr/datasets/generator/base.py", line 126, in __init__
raise ValueError(f"unable to locate font: {font}")
ValueError: unable to locate font: FreeMono.ttf
Environment
google colab
lib versions:
absl-py==1.4.0
accelerate==1.9.0
aiofiles==24.1.0
aiohappyeyeballs==2.6.1
aiohttp==3.12.15
aiosignal==1.4.0
alabaster==1.0.0
albucore==0.0.24
albumentations==2.0.8
ale-py==0.11.2
altair==5.5.0
annotated-types==0.7.0
antlr4-python3-runtime==4.9.3
anyascii==0.3.3
anyio==4.10.0
anywidget==0.9.18
argon2-cffi==25.1.0
argon2-cffi-bindings==25.1.0
array_record==0.7.2
arviz==0.22.0
astropy==7.1.0
astropy-iers-data==0.2025.8.4.0.42.59
astunparse==1.6.3
atpublic==5.1
attrs==25.3.0
audioread==3.0.1
autograd==1.8.0
babel==2.17.0
backcall==0.2.0
backports.tarfile==1.2.0
beautifulsoup4==4.13.4
betterproto==2.0.0b6
bigframes==2.13.0
bigquery-magics==0.10.2
bleach==6.2.0
blinker==1.9.0
blis==1.3.0
blobfile==3.0.0
blosc2==3.6.1
bokeh==3.7.3
Bottleneck==1.4.2
bqplot==0.12.45
branca==0.8.1
Brotli==1.1.0
build==1.3.0
CacheControl==0.14.3
cachetools==5.5.2
catalogue==2.0.10
certifi==2025.8.3
cffi==1.17.1
chardet==5.2.0
charset-normalizer==3.4.2
chex==0.1.90
clarabel==0.11.1
clearml==2.0.2
click==8.2.1
cloudpathlib==0.21.1
cloudpickle==3.1.1
cmake==3.31.6
cmdstanpy==1.2.5
colorcet==3.1.0
colorlover==0.3.0
colour==0.1.5
community==1.0.0b1
confection==0.1.5
cons==0.4.7
contourpy==1.3.3
cramjam==2.11.0
cryptography==43.0.3
cuda-python==12.6.2.post1
cudf-cu12 @ https://pypi.nvidia.com/cudf-cu12/cudf_cu12-25.6.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
cudf-polars-cu12==25.6.0
cufflinks==0.17.3
cuml-cu12==25.6.0
cupy-cuda12x==13.3.0
curl_cffi==0.13.0
cuvs-cu12==25.6.1
cvxopt==1.3.2
cvxpy==1.6.7
cycler==0.12.1
cyipopt==1.5.0
cymem==2.0.11
Cython==3.0.12
dask==2025.5.0
dask-cuda==25.6.0
dask-cudf-cu12==25.6.0
dataproc-spark-connect==0.8.3
datasets==4.0.0
db-dtypes==1.4.3
dbus-python==1.2.18
debugpy==1.8.15
decorator==4.4.2
defusedxml==0.7.1
diffusers==0.34.0
dill==0.3.8
distributed==2025.5.0
distributed-ucxx-cu12==0.44.0
distro==1.9.0
dlib==19.24.6
dm-tree==0.1.9
docstring_parser==0.17.0
docutils==0.21.2
dopamine_rl==4.1.2
duckdb==1.3.2
earthengine-api==1.5.24
easydict==1.13
editdistance==0.8.1
eerepr==0.1.2
einops==0.8.1
en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl#sha256=1932429db727d4bff3deed6b34cfc05df17794f4a52eeb26cf8928f7c1a0fb85
entrypoints==0.4
et_xmlfile==2.0.0
etils==1.13.0
etuples==0.3.10
Farama-Notifications==0.0.4
fastai==2.7.19
fastapi==0.116.1
fastcore==1.7.29
fastdownload==0.0.7
fastjsonschema==2.21.1
fastprogress==1.0.3
fastrlock==0.8.3
ffmpy==0.6.1
filelock==3.18.0
firebase-admin==6.9.0
Flask==3.1.1
flatbuffers==25.2.10
flax==0.10.6
folium==0.20.0
fonttools==4.59.0
frozendict==2.4.6
frozenlist==1.7.0
fsspec==2025.3.0
furl==2.1.4
future==1.0.0
gast==0.6.0
gcsfs==2025.3.0
GDAL==3.8.4
gdown==5.2.0
geemap==0.35.3
geocoder==1.38.1
geographiclib==2.0
geopandas==1.1.1
geopy==2.4.1
gin-config==0.5.0
gitdb==4.0.12
GitPython==3.1.45
glob2==0.7
google==2.0.3
google-ai-generativelanguage==0.6.15
google-api-core==2.25.1
google-api-python-client==2.177.0
google-auth==2.38.0
google-auth-httplib2==0.2.0
google-auth-oauthlib==1.2.2
google-cloud-aiplatform==1.106.0
google-cloud-bigquery==3.35.1
google-cloud-bigquery-connection==1.18.3
google-cloud-bigquery-storage==2.32.0
google-cloud-core==2.4.3
google-cloud-dataproc==5.21.0
google-cloud-datastore==2.21.0
google-cloud-firestore==2.21.0
google-cloud-functions==1.20.4
google-cloud-language==2.17.2
google-cloud-resource-manager==1.14.2
google-cloud-spanner==3.56.0
google-cloud-storage==2.19.0
google-cloud-translate==3.21.1
google-colab @ file:///colabtools/dist/google_colab-1.0.0.tar.gz
google-crc32c==1.7.1
google-genai==1.28.0
google-generativeai==0.8.5
google-pasta==0.2.0
google-resumable-media==2.7.2
googleapis-common-protos==1.70.0
googledrivedownloader==1.1.0
gradio==5.41.0
gradio_client==1.11.0
graphviz==0.21
greenlet==3.2.3
groovy==0.1.2
grpc-google-iam-v1==0.14.2
grpc-interceptor==0.15.4
grpcio==1.74.0
grpcio-status==1.71.2
grpclib==0.4.8
gspread==6.2.1
gspread-dataframe==4.0.0
gym==0.25.2
gym-notices==0.1.0
gymnasium==1.2.0
h11==0.16.0
h2==4.2.0
h5netcdf==1.6.4
h5py==3.14.0
hdbscan==0.8.40
hf-xet==1.1.7
hf_transfer==0.1.9
highspy==1.11.0
holidays==0.78
holoviews==1.21.0
hpack==4.1.0
html5lib==1.1
httpcore==1.0.9
httpimport==1.4.1
httplib2==0.22.0
httpx==0.28.1
huggingface-hub==0.34.3
humanize==4.12.3
hyperframe==6.1.0
hyperopt==0.2.7
ibis-framework==9.5.0
idna==3.10
imageio==2.37.0
imageio-ffmpeg==0.6.0
imagesize==1.4.1
imbalanced-learn==0.13.0
immutabledict==4.2.1
importlib_metadata==8.7.0
importlib_resources==6.5.2
imutils==0.5.4
inflect==7.5.0
iniconfig==2.1.0
intel-cmplr-lib-ur==2025.2.0
intel-openmp==2025.2.0
ipyevents==2.0.2
ipyfilechooser==0.6.0
ipykernel==6.17.1
ipyleaflet==0.20.0
ipyparallel==8.8.0
ipython==7.34.0
ipython-genutils==0.2.0
ipython-sql==0.5.0
ipytree==0.2.2
ipywidgets==7.7.1
itsdangerous==2.2.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.2.1
jax==0.5.3
jax-cuda12-pjrt==0.5.3
jax-cuda12-plugin==0.5.3
jaxlib==0.5.3
jeepney==0.9.0
jieba==0.42.1
Jinja2==3.1.6
jiter==0.10.0
joblib==1.5.1
jsonpatch==1.33
jsonpickle==4.1.1
jsonpointer==3.0.0
jsonschema==4.25.0
jsonschema-specifications==2025.4.1
jupyter-client==6.1.12
jupyter-console==6.1.0
jupyter-leaflet==0.20.0
jupyter-server==1.16.0
jupyter_core==5.8.1
jupyter_kernel_gateway @ git+https://github.com/googlecolab/kernel_gateway@b134e9945df25c2dcb98ade9129399be10788671
jupyterlab_pygments==0.3.0
jupyterlab_widgets==3.0.15
jupytext==1.17.2
kaggle==1.7.4.5
kagglehub==0.3.12
keras==3.10.0
keras-hub==0.21.1
keras-nlp==0.21.1
keyring==25.6.0
keyrings.google-artifactregistry-auth==1.1.2
kiwisolver==1.4.8
langchain==0.3.27
langchain-core==0.3.72
langchain-text-splitters==0.3.9
langcodes==3.5.0
langdetect==1.0.9
langsmith==0.4.12
language_data==1.3.0
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
lazy_loader==0.4
libclang==18.1.1
libcudf-cu12 @ https://pypi.nvidia.com/libcudf-cu12/libcudf_cu12-25.6.0-py3-none-manylinux_2_28_x86_64.whl
libcugraph-cu12==25.6.0
libcuml-cu12==25.6.0
libcuvs-cu12==25.6.1
libkvikio-cu12==25.6.0
libpysal==4.13.0
libraft-cu12==25.6.0
librmm-cu12==25.6.0
librosa==0.11.0
libucx-cu12==1.18.1
libucxx-cu12==0.44.0
lightgbm @ file:///tmp/lightgbm/LightGBM/dist/lightgbm-4.6.0-py3-none-linux_x86_64.whl
linkify-it-py==2.0.3
llvmlite==0.43.0
locket==1.0.0
logical-unification==0.4.6
lxml==5.4.0
Mako==1.1.3
marisa-trie==1.2.1
Markdown==3.8.2
markdown-it-py==3.0.0
MarkupSafe==3.0.2
matplotlib==3.10.0
matplotlib-inline==0.1.7
matplotlib-venn==1.1.2
mdit-py-plugins==0.4.2
mdurl==0.1.2
miniKanren==1.0.5
missingno==0.5.2
mistune==3.1.3
mizani==0.13.5
mkl==2025.2.0
ml_dtypes==0.5.3
mlxtend==0.23.4
more-itertools==10.7.0
moviepy==1.0.3
mpmath==1.3.0
msgpack==1.1.1
multidict==6.6.3
multipledispatch==1.0.0
multiprocess==0.70.16
multitasking==0.0.12
murmurhash==1.0.13
music21==9.3.0
namex==0.1.0
narwhals==2.0.1
natsort==8.4.0
nbclassic==1.3.1
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
ndindex==1.10.0
nest-asyncio==1.6.0
networkx==3.5
nibabel==5.3.2
nltk==3.9.1
notebook==6.5.7
notebook_shim==0.2.4
numba==0.60.0
numba-cuda==0.11.0
numexpr==2.11.0
numpy==2.0.2
nvidia-cublas-cu12==12.4.5.8
nvidia-cuda-cupti-cu12==12.4.127
nvidia-cuda-nvcc-cu12==12.5.82
nvidia-cuda-nvrtc-cu12==12.4.127
nvidia-cuda-runtime-cu12==12.4.127
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.2.1.3
nvidia-curand-cu12==10.3.5.147
nvidia-cusolver-cu12==11.6.1.9
nvidia-cusparse-cu12==12.3.1.170
nvidia-cusparselt-cu12==0.6.2
nvidia-ml-py==12.575.51
nvidia-nccl-cu12==2.21.5
nvidia-nvjitlink-cu12==12.4.127
nvidia-nvtx-cu12==12.4.127
nvtx==0.2.13
nx-cugraph-cu12 @ https://pypi.nvidia.com/nx-cugraph-cu12/nx_cugraph_cu12-25.6.0-py3-none-any.whl
oauth2client==4.1.3
oauthlib==3.3.1
omegaconf==2.3.0
onnx==1.18.0
openai==1.99.1
opencv-contrib-python==4.12.0.88
opencv-python==4.12.0.88
opencv-python-headless==4.12.0.88
openpyxl==3.1.5
opt_einsum==3.4.0
optax==0.2.5
optree==0.17.0
orbax-checkpoint==0.11.20
orderedmultidict==1.0.1
orjson==3.11.1
osqp==1.0.4
packaging==25.0
pandas==2.2.2
pandas-datareader==0.10.0
pandas-gbq==0.29.2
pandas-stubs==2.2.2.240909
pandocfilters==1.5.1
panel==1.7.5
param==2.2.1
parso==0.8.4
parsy==2.1
partd==1.4.2
pathlib2==2.3.7.post1
patsy==1.0.1
peewee==3.18.2
peft==0.17.0
pexpect==4.9.0
pickleshare==0.7.5
pillow @ https://github.com/python-pillow/Pillow/archive/master.zip#sha256=58249058f0edc687613855b8d599f591ef8a27615a3a345a9ad09f306c2fd1cd
platformdirs==4.3.8
plotly==5.24.1
plotnine==0.14.5
pluggy==1.6.0
ply==3.11
polars==1.25.2
pooch==1.8.2
portpicker==1.5.2
preshed==3.0.10
prettytable==3.16.0
proglog==0.1.12
progressbar2==4.5.0
prometheus_client==0.22.1
promise==2.3
prompt_toolkit==3.0.51
propcache==0.3.2
prophet==1.1.7
proto-plus==1.26.1
protobuf==5.29.5
psutil==5.9.5
psycopg2==2.9.10
psygnal==0.14.0
ptyprocess==0.7.0
py-cpuinfo==9.0.0
py4j==0.10.9.7
pyarrow==18.1.0
pyasn1==0.6.1
pyasn1_modules==0.4.2
pycairo==1.28.0
pyclipper==1.3.0.post6
pycocotools==2.0.10
pycparser==2.22
pycryptodomex==3.23.0
pydantic==2.11.7
pydantic_core==2.33.2
pydata-google-auth==1.9.1
pydot==3.0.4
pydotplus==2.0.2
PyDrive2==1.21.3
pydub==0.25.1
pyerfa==2.0.1.5
pygame==2.6.1
pygit2==1.18.1
Pygments==2.19.2
PyGObject==3.42.0
PyJWT==2.10.1
pylibcudf-cu12 @ https://pypi.nvidia.com/pylibcudf-cu12/pylibcudf_cu12-25.6.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
pylibcugraph-cu12==25.6.0
pylibraft-cu12==25.6.0
pymc==5.25.1
pynndescent==0.5.13
pynvjitlink-cu12==0.7.0
pynvml==12.0.0
pyogrio==0.11.1
pyomo==6.9.2
PyOpenGL==3.1.9
pyOpenSSL==24.2.1
pyparsing==3.2.3
pypdfium2==4.30.0
pyperclip==1.9.0
pyproj==3.7.1
pyproject_hooks==1.2.0
pyshp==2.3.1
PySocks==1.7.1
pyspark==3.5.1
pytensor==2.31.7
pytest==8.4.1
python-apt==0.0.0
python-box==7.3.2
python-dateutil==2.9.0.post0
-e git+https://github.com/mindee/doctr.git@951c6d03ad03706df21f7d8f21f2375c31969dee#egg=python_doctr
python-louvain==0.16
python-multipart==0.0.20
python-slugify==8.0.4
python-snappy==0.7.3
python-utils==3.9.1
pytz==2025.2
pyviz_comms==3.0.6
PyWavelets==1.9.0
PyYAML==6.0.2
pyzmq==26.2.1
raft-dask-cu12==25.6.0
RapidFuzz==3.13.0
rapids-dask-dependency==25.6.0
rapids-logger==0.1.1
ratelim==0.1.6
referencing==0.36.2
regex==2024.11.6
requests==2.32.3
requests-oauthlib==2.0.0
requests-toolbelt==1.0.0
requirements-parser==0.9.0
rich==13.9.4
rmm-cu12==25.6.0
roman-numerals-py==3.1.0
rpds-py==0.26.0
rpy2==3.5.17
rsa==4.9.1
ruff==0.12.7
safehttpx==0.1.6
safetensors==0.6.1
scikit-image==0.25.2
scikit-learn==1.6.1
scipy==1.16.1
scooby==0.10.1
scs==3.2.7.post2
seaborn==0.13.2
SecretStorage==3.3.3
semantic-version==2.10.0
Send2Trash==1.8.3
sentence-transformers==5.0.0
sentencepiece==0.2.0
sentry-sdk==2.34.1
shap==0.48.0
shapely==2.1.1
shellingham==1.5.4
simple-parsing==0.1.7
simplejson==3.20.1
simsimd==6.5.0
six==1.17.0
sklearn-compat==0.1.3
sklearn-pandas==2.2.0
slack_sdk==3.36.0
slicer==0.0.8
smart_open==7.3.0.post1
smmap==5.0.2
sniffio==1.3.1
snowballstemmer==3.0.1
sortedcontainers==2.4.0
soundfile==0.13.1
soupsieve==2.7
soxr==0.5.0.post1
spacy==3.8.7
spacy-legacy==3.0.12
spacy-loggers==1.0.5
spanner-graph-notebook==1.1.7
Sphinx==8.2.3
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
SQLAlchemy==2.0.42
sqlglot==25.20.2
sqlparse==0.5.3
srsly==2.5.1
stanio==0.5.1
starlette==0.47.2
statsmodels==0.14.5
stringzilla==3.12.5
stumpy==1.13.0
sympy==1.13.1
tables==3.10.2
tabulate==0.9.0
tbb==2022.2.0
tblib==3.1.0
tcmlib==1.4.0
tenacity==8.5.0
tensorboard==2.19.0
tensorboard-data-server==0.7.2
tensorflow==2.19.0
tensorflow-datasets==4.9.9
tensorflow-hub==0.16.1
tensorflow-io-gcs-filesystem==0.37.1
tensorflow-metadata==1.17.2
tensorflow-probability==0.25.0
tensorflow-text==2.19.0
tensorflow_decision_forests==1.12.0
tensorstore==0.1.76
termcolor==3.1.0
terminado==0.18.1
text-unidecode==1.3
textblob==0.19.0
tf-slim==1.1.0
tf_keras==2.19.0
thinc==8.3.6
threadpoolctl==3.6.0
tifffile==2025.6.11
tiktoken==0.10.0
timm==1.0.19
tinycss2==1.4.0
tokenizers==0.21.4
toml==0.10.2
tomlkit==0.13.3
toolz==0.12.1
torch @ https://download.pytorch.org/whl/cu124/torch-2.6.0%2Bcu124-cp311-cp311-linux_x86_64.whl
torchao==0.10.0
torchaudio @ https://download.pytorch.org/whl/cu124/torchaudio-2.6.0%2Bcu124-cp311-cp311-linux_x86_64.whl
torchdata==0.11.0
torchsummary==1.5.1
torchtune==0.6.1
torchvision @ https://download.pytorch.org/whl/cu124/torchvision-0.21.0%2Bcu124-cp311-cp311-linux_x86_64.whl
tornado==6.4.2
tqdm==4.67.1
traitlets==5.7.1
traittypes==0.2.1
transformers==4.55.0
treelite==4.4.1
treescope==0.1.9
triton==3.2.0
tsfresh==0.21.0
tweepy==4.16.0
typeguard==4.4.4
typer==0.16.0
types-pytz==2025.2.0.20250516
types-setuptools==80.9.0.20250801
typing-inspection==0.4.1
typing_extensions==4.14.1
tzdata==2025.2
tzlocal==5.3.1
uc-micro-py==1.0.3
ucx-py-cu12==0.44.0
ucxx-cu12==0.44.0
umap-learn==0.5.9.post2
umf==0.11.0
uritemplate==4.2.0
urllib3==2.5.0
uvicorn==0.35.0
validators==0.35.0
vega-datasets==0.9.0
wadllib==1.3.6
wandb==0.21.0
wasabi==1.1.3
wcwidth==0.2.13
weasel==0.4.1
webcolors==24.11.1
webencodings==0.5.1
websocket-client==1.8.0
websockets==15.0.1
Werkzeug==3.1.3
widgetsnbextension==3.6.10
wordcloud==1.9.4
wrapt==1.17.2
wurlitzer==3.1.1
xarray==2025.7.1
xarray-einstats==0.9.1
xgboost==3.0.3
xlrd==2.0.2
xxhash==3.5.0
xyzservices==2025.4.0
yarl==1.20.1
ydf==0.13.0
yellowbrick==1.5
yfinance==0.2.65
zict==3.0.0
zipp==3.23.0
zstandard==0.23.0
But when I ran:
wget https://raw.githubusercontent.com/mindee/doctr/main/scripts/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
I got:
--2025-08-09 17:39:17-- https://raw.githubusercontent.com/mindee/doctr/main/scripts/collect_env.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9355 (9.1K) [text/plain]
Saving to: ‘collect_env.py’
collect_env.py 100%[===================>] 9.14K --.-KB/s in 0.001s
2025-08-09 17:39:17 (14.0 MB/s) - ‘collect_env.py’ saved [9355/9355]
Collecting environment information...
Traceback (most recent call last):
File "/content/collect_env.py", line 320, in <module>
main()
File "/content/collect_env.py", line 315, in main
output = get_pretty_env_info()
^^^^^^^^^^^^^^^^^^^^^
File "/content/collect_env.py", line 310, in get_pretty_env_info
return pretty_str(get_env_info())
^^^^^^^^^^^^^^
File "/content/collect_env.py", line 228, in get_env_info
doctr_str = doctr.__version__ if DOCTR_AVAILABLE else "N/A"
^^^^^^^^^^^^^^^^^
AttributeError: module 'doctr' has no attribute '__version__'
Metadata
Metadata
Assignees
Labels
type: bugSomething isn't workingSomething isn't working