Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making-Decorrelation-and-Topic-Selection-Friends.ipynb Doesn't work in google colab from scratch #87

Open
brothertook opened this issue Oct 14, 2022 · 2 comments · May be fixed by #98
Open
Assignees
Labels
bug Something isn't working

Comments

@brothertook
Copy link

brothertook commented Oct 14, 2022

!pip install topicnet
TopicNet in /usr/local/lib/python3.7/dist-packages (0.8.0)
`
%%time

enable_hide_warnings()

models = decorrelating_cube(topic_model, dataset) # TODO: nice cube output?


To toggle on/off output_stderr, click here.

/usr/local/lib/python3.7/dist-packages/dill/_dill.py:1845: PicklingWarning: Cannot locate reference to <class '_ctypes.PyCFuncPtrType'>.
warnings.warn('Cannot locate reference to %r.' % (obj,), PicklingWarning)
/usr/local/lib/python3.7/dist-packages/dill/_dill.py:1847: PicklingWarning: Cannot pickle <class '_ctypes.PyCFuncPtrType'>: _ctypes.PyCFuncPtrType has recursive self-references that trigger a RecursionError.
warnings.warn('Cannot pickle %r: %s.%s has recursive self-references that trigger a RecursionError.' % (obj, obj.module, obj_name), PicklingWarning)
/usr/local/lib/python3.7/dist-packages/topicnet/cooking_machine/models/topic_model.py:427: UserWarning: Failed to save custom score "ActiveTopicNumberScore" correctly! Freezing score (saving only its value)
f'Failed to save custom score "{score_object}" correctly! '
`

`enable_hide_warnings()

To toggle on/off output_stderr, click here.


TypeError Traceback (most recent call last)

in
2
3 best_model, DECORRELATION_TAU = select_best_model(
----> 4 topic_model.experiment, CRITERION, DECORRELATE_SPECIFIC
5 )

6 frames

/usr/local/lib/python3.7/dist-packages/topicnet/cooking_machine/models/scores_wrapper.py in add(self, score)
54 def add(self, score: Union[BaseScore, artm.scores.BaseScore]):
55 if isinstance(score, FrozenScore):
---> 56 raise TypeError('FrozenScore is not supposed to be added to model')
57
58 elif isinstance(score, BaseScore):

TypeError: FrozenScore is not supposed to be added to model

`

@Alvant Alvant self-assigned this Jul 14, 2024
@Alvant Alvant added the bug Something isn't working label Jul 14, 2024
@Alvant
Copy link
Collaborator

Alvant commented Jul 15, 2024

@brothertook thank you for the note!

This is the fixed version of the notebook: https://github.com/machine-intelligence-laboratory/TopicNet/blob/bugfix/fix-datasets-loading/topicnet/demos/Making-Decorrelation-and-Topic-Selection-Friends.ipynb. (Soon it will be merged in main repo branch as part of the PR #98.)

Tested locally — seems like works. (But not sure about Colab, will it work here or not 😅 because Colab + TopicNet/BigARTM duo might have some kind of its own "bats in the belfry".)

Hope you are fine) Have a nice day!

@Alvant
Copy link
Collaborator

Alvant commented Jul 15, 2024

Ups, sure, it is not going to work in Colab yet, because the aforementioned PR also contains some other fixes in the code (vanilla pip install topicnet will not fetch the fixes until the PR is merged).

Well, stay tuned) I'll try notebook in Colab later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants