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

Unable to use signature extraction library #218

Open
ghost opened this issue May 5, 2021 · 1 comment
Open

Unable to use signature extraction library #218

ghost opened this issue May 5, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented May 5, 2021

c:\Development\iMemori>python src\test.py -i src\imem.properties
Traceback (most recent call last):
File "c:\Development\iMemori\src\test.py", line 6, in
from talon import signature
File "C:\Applications\Python\3.9.4\lib\site-packages\talon\signature_init_.py", line 28, in
from . learning import classifier
File "C:\Applications\Python\3.9.4\lib\site-packages\talon\signature\learning\classifier.py", line 11, in
from talon import joblib
ImportError: cannot import name 'joblib' from 'talon' (C:\Applications\Python\3.9.4\lib\site-packages\talon_init_.py)

Editing above classifier.py library to use import joblib result in below error

Traceback (most recent call last):
File "C:\Applications\Python\3.9.4\lib\site-packages\talon\signature\learning\classifier.py", line 34, in load
return joblib.load(saved_classifier_filename)
File "C:\Applications\Python\3.9.4\lib\site-packages\joblib\numpy_pickle.py", line 585, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "C:\Applications\Python\3.9.4\lib\site-packages\joblib\numpy_pickle.py", line 504, in _unpickle
obj = unpickler.load()
File "C:\Applications\Python\3.9.4\lib\pickle.py", line 1212, in load
dispatchkey[0]
File "C:\Applications\Python\3.9.4\lib\pickle.py", line 1528, in load_global
klass = self.find_class(module, name)
File "C:\Applications\Python\3.9.4\lib\pickle.py", line 1579, in find_class
import(module, level=0)
ModuleNotFoundError: No module named 'sklearn.svm.classes'

@KadenWolff
Copy link

After you've updated the joblib import (which you've done), it's easiest to just retrain the model, which can be done with these lines. Either run it as a script or just run it directly in python interactive shell.

from talon.signature import EXTRACTOR_FILENAME, EXTRACTOR_DATA
from talon.signature.learning.classifier import train, init
train(init(), EXTRACTOR_DATA, EXTRACTOR_FILENAME)

There are a bunch of PRs to fix this like #219, hopefully one will be approved at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant