I downloaded the Deep Speech model from https://s3-us-west-1.amazonaws.com/nervana-modelzoo/Deep_Speech/Librispeech/librispeech_16_epochs.prm per the following the instructions at: https://github.com/NervanaSystems/deepspeech.
However, I cannot load the model in??
In [1]: import os
...: import numpy as np
...: import pickle as pkl
...:
...: import json
...: # from aeon import DataLoader
...: from aeon.dataloader import DataLoader
...: from neon.backends import gen_backend
...: from neon.util.argparser import NeonArgparser, extract_valid_args
...: from neon.models import Model
...: from neon.data.dataloader_transformers import TypeCast, Retuple
...:
...: from decoder import ArgMaxDecoder
...: from utils import get_wer
...:
DISPLAY:neon:mklEngine.so not found; falling back to cpu backend
In [2]: model_file = 'librispeech_16_epochs.prm'
In [3]: Model(model_file)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-476a66425bb7> in <module>()
----> 1 Model(model_file)
/Users/kni/Tools/miniconda3/envs/neon-2.7/lib/python2.7/site-packages/neon-2.1.0-py2.7.egg/neon/models/model.pyc in __init__(self, layers, dataset, weights_only, name, optimizer)
70 self.deserialize(layers, load_states=(not weights_only))
71 elif isinstance(layers, (str, bytes)):
---> 72 self.load_params(layers, load_states=(not weights_only))
73 else:
74 # Wrap the list of layers in a Sequential container if a raw list of layers
/Users/kni/Tools/miniconda3/envs/neon-2.7/lib/python2.7/site-packages/neon-2.1.0-py2.7.egg/neon/models/model.pyc in load_params(self, param_path, load_states)
412 states as well
413 """
--> 414 self.deserialize(load_obj(param_path), load_states=load_states)
415 logger.info('Model weights loaded from %s', param_path)
416
/Users/kni/Tools/miniconda3/envs/neon-2.7/lib/python2.7/site-packages/neon-2.1.0-py2.7.egg/neon/models/model.pyc in deserialize(self, model_dict, data, load_states)
463 if 'backend' in model_dict:
464 if 'compat_mode' in model_dict['backend']:
--> 465 self.be.compat_mode = model_dict['backend']['compat_mode']
466 else:
467 model_dict['backend'] = {}
AttributeError: 'NoneType' object has no attribute 'compat_mode'
This error occurs when you haven't yet declared your backend. Just call be = gen_backend("gpu") or be = gen_backend("cpu") before your call to Model(model_file).
Hello,
I downloaded the Deep Speech model from
https://s3-us-west-1.amazonaws.com/nervana-modelzoo/Deep_Speech/Librispeech/librispeech_16_epochs.prm
per the following the instructions at: https://github.com/NervanaSystems/deepspeech.However, I cannot load the model in??