Closed Nim248 closed 1 year ago
Hi @Nim248, thanks for reporting this.
Unfortunately, I cannot reproduce your problem. I have tried both a colab instance and a local setup (including several configurations of pytorch/transformer versions) for testing but never encountered this error.
Did you modify the original code?
The only change I made is here (changed cuda to cpu). I am using "small-text" without "[transformers]" on a Jupyter notebook.
clf_factory = TransformerBasedClassificationFactory(transformer_model, num_classes, kwargs=dict({ 'device': 'cpu', 'mini_batch_size': 32, 'class_weight': 'balanced' }))
The only change I made is here (changed cuda to cpu).
Strange, still no error for me. Can you try again with a fresh notebook (use the link in the README.md).
Besides, are you sure that you want to use this without a GPU? The training process takes so much longer on a CPU. A GPU from Colab is sufficient for many models.
I am using "small-text" without "[transformers]" on a Jupyter notebook.
This is likely not the case, probably even impossible. The error you posted shows the transformer classifier in the stacktrace. If you tried to use small-text transformers functionality without having transformers installed there will be errors much earlier (e.g., when you try to prepare the data).
Maybe you installed it during your first try. The "transformers" seems to be still present here. This is why I recommended to start with a clean environment above.
There does seem to be a mismatch in libraries. I have installed cuda and pytorch but this piece of code still gives me another error:
RuntimeError Traceback (most recent call last)
Thank you again for the feedback and for updating the issue.
The problem could be due to a version mismatch, but the resulting error is not helpful. I will investigate this further.
Bug description
I am getting the following error
RuntimeError: expected scalar type Long but found Int
related to the line
indices_labeled = initialize_active_learner(active_learner, train.y)
in the code provided here
https://github.com/webis-de/small-text/blob/v1.1.1/examples/notebooks/02-active-learning-with-stopping-criteria.ipynb
I am using the latest version.
Python version: 3.8.8 small-text version: 1.1.1 torch version (if applicable): 1.13.0+cpu
Full error:
RuntimeError Traceback (most recent call last)