Warning when training ensembles

26 views
Skip to first unread message

Tobias Bülte

unread,
Apr 1, 2025, 4:53:52 AMApr 1
to Annif Users
Using
Python 3.12.3
I followed the basic install, resulting in Annif Version:
1.4.0.dev0

[nwbib-triple-ensemble]
name=Ensemble (TFIDF + fastText + Omikuji) NWBib
language=de
backend=ensemble
vocab=nwbib-de
sources=nwbib-tfidf,nwbib-fasttext:2,nwbib-omikuji:2
and
[nwbib-triple-ensemble-nn]
name=Ensemble (TFIDF + fastText + Omikuji) NWBib with neural network
language=de
backend=nn_ensemble
vocab=nwbib-de
sources=nwbib-tfidf,nwbib-fasttext:2,nwbib-omikuji:2
nodes=200
dropout_rate=0.2
epochs=15
lmdb_map_size=8589934592

For both training works:
annif train nwbib-ensemble-nn nwbib-data/nwbib_subjects_train.tsv -j 8
annif train nwbib-triple-ensemble-nn nwbib-data/nwbib_subjects_train.tsv -j 8

but while training there is a warning popping up, which I cannot interpret as problematic or not:

/home/user/git/Annif/annif-venv/lib/python3.12/site-packages/keras/src/trainers/data_adapters/py_dataset_adapter.py:121: UserWarning: Your `PyDataset` class should call `super().__init__(**kwargs)` in its constructor. `**kwargs` can include `workers`, `use_multiprocessing`, `max_queue_size`. Do not pass these arguments to `fit()`, as they will be ignored.
  self._warn_if_super_not_called()

Can anybody help interpreting this warning?

Project specifics are here:

Osma Suominen

unread,
Apr 7, 2025, 3:53:25 AMApr 7
to annif...@googlegroups.com
Hi Tobias!

Thanks for the detailed report. This seems to be a pretty harmless
warning - I think things should work regardless of the warning. But it
points to a bug in the NN ensemble backend - the LMDBSequence
constructor is missing a call to the superclass constructor. I have just
opened a pull request that fixes the issue:

https://github.com/NatLibFi/Annif/pull/847

Once we get this fix merged and into a future Annif release, the warning
should go away.

Best,
Osma
> --
> You received this message because you are subscribed to the Google
> Groups "Annif Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to annif-users...@googlegroups.com <mailto:annif-
> users+un...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/annif-
> users/be86e183-81c4-49ff-aaca-e578527c766bn%40googlegroups.com <https://
> groups.google.com/d/msgid/annif-users/be86e183-81c4-49ff-aaca-
> e578527c766bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 15 (Unioninkatu 36)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.s...@helsinki.fi
http://www.nationallibrary.fi

Reply all
Reply to author
Forward
0 new messages