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

Recommendation of fixing numpy version due to error when calling parser.load_models(·) #19

Open
ivsanro1 opened this issue Mar 5, 2020 · 1 comment

Comments

@ivsanro1
Copy link

ivsanro1 commented Mar 5, 2020

Hello,

If your requirement is just "numpy", it will install the latest version (e.g. numpy-1.17.5 as of the day this issue was created), and this leads to an error when loading the model with the parser:

Object arrays cannot be loaded when allow_pickle=False

Which can be solved by downgrading the numpy version (e.g. to version 1.16.1)

I suggest changing this at least in the requirements specified in the README.

@abneetwats24
Copy link

Also You can chgange load method in ner.py as
def load_models(self, loc=None):
if not loc:
loc = os.path.join(os.path.expanduser('~'), '.ner_model')
self.model = load_model(os.path.join(loc,"model.h5"))
# loading word2Idx
np.load.defaults=(None, True, True, 'ASCII')
self.word2Idx = np.load(os.path.join(loc,"word2Idx.npy")).item()
# loading idx2Label
self.idx2Label = np.load(os.path.join(loc,"idx2Label.npy")).item()
np.load.defaults=(None, False, True, 'ASCII')

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

2 participants