Precise Model Development


#1

I’ve been trying to develop a wake word recognition model with the precise tool set. I can collect data, and am able to generate the model and created my emilia.net file. However, when I attempt to convert it to a .pb file with precise-convert I get exceptions in loading the tensor flow, if I try to verify my emilia.net with precise-listen I get other exceptions. As verbose as it all is here are the exceptions. I can provide as more detail if it would help.
------------- precise-listen error ---------------------
[jnickel:~/src/mycroft-precise] [.venv] dev* ± precise-listen emilia.net
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint8 = np.dtype([(“qint8”, np.int8, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint8 = np.dtype([(“quint8”, np.uint8, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:528: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint16 = np.dtype([(“qint16”, np.int16, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:529: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint16 = np.dtype([(“quint16”, np.uint16, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:530: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint32 = np.dtype([(“qint32”, np.int32, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:535: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
np_resource = np.dtype([(“resource”, np.ubyte, 1)])
Using TensorFlow backend.
WARNING:tensorflow:From /home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/lib/python3.7/threading.py”, line 917, in _bootstrap_inner
self.run()
File “/usr/lib/python3.7/threading.py”, line 865, in run
self._target(*self._args, **self._kwargs)
File “/home/jnickel/src/mycroft-precise/runner/precise_runner/runner.py”, line 236, in _handle_predictions
prob = self.engine.get_prediction(chunk)
File “/home/jnickel/src/mycroft-precise/precise/scripts/listen.py”, line 87, in get_prediction
return listener.update(chunk)
File “/home/jnickel/src/mycroft-precise/precise/network_runner.py”, line 139, in update
raw_output = self.runner.run(mfccs)
File “/home/jnickel/src/mycroft-precise/precise/network_runner.py”, line 82, in run
return self.predict(inp[np.newaxis])[0][0]
File “/home/jnickel/src/mycroft-precise/precise/network_runner.py”, line 79, in predict
return self.model.predict(inputs)
File “/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/training.py”, line 1462, in predict
callbacks=callbacks)
File “/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/training_arrays.py”, line 324, in predict_loop
batch_outs = f(ins_batch)
File “/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/keras/backend.py”, line 3076, in call
run_metadata=self.run_metadata)
File “/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 1439, in call
run_metadata_ptr)
File “/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/errors_impl.py”, line 528, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable dense_1/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/dense_1/bias)
[[{{node dense_1/BiasAdd/ReadVariableOp}}]]

^CTraceback (most recent call last):
  File "/home/jnickel/src/mycroft-precise/.venv/bin/precise-listen", line 11, in <module>
    load_entry_point('mycroft-precise', 'console_scripts', 'precise-listen')()
  File "/home/jnickel/src/mycroft-precise/precise/scripts/listen.py", line 94, in main
    Event().wait()  # Wait forever
  File "/usr/lib/python3.7/threading.py", line 552, in wait
    signaled = self._cond.wait(timeout)
  File "/usr/lib/python3.7/threading.py", line 296, in wait
    waiter.acquire()
KeyboardInterrupt

------------- precise-convert error ------------------
[jnickel:~/src/mycroft-precise] [.venv] dev* ± precise-convert emilia.net
Converting emilia.net to emilia.pb ...
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Using TensorFlow backend.
WARNING:tensorflow:From /home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
Traceback (most recent call last):
  File "/home/jnickel/src/mycroft-precise/.venv/bin/precise-convert", line 11, in <module>
    load_entry_point('mycroft-precise', 'console_scripts', 'precise-convert')()
  File "/home/jnickel/src/mycroft-precise/precise/scripts/convert.py", line 83, in main
    convert(args.model, args.out.format(model=model_name))
  File "/home/jnickel/src/mycroft-precise/precise/scripts/convert.py", line 51, in convert
    model = load_precise_model(model_path)
  File "/home/jnickel/src/mycroft-precise/precise/model.py", line 48, in load_precise_model
    return load_keras().models.load_model(model_name)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/saving.py", line 492, in load_wrapper
    return load_function(*args, **kwargs)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/saving.py", line 584, in load_model
    model = _deserialize_model(h5dict, custom_objects, compile)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/saving.py", line 274, in _deserialize_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/saving.py", line 627, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/layers/__init__.py", line 168, in deserialize
    printable_module_name='layer')
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/utils/generic_utils.py", line 147, in deserialize_keras_object
    list(custom_objects.items())))
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/sequential.py", line 302, in from_config
    model.add(layer)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/sequential.py", line 166, in add
    layer(x)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/layers/recurrent.py", line 541, in __call__
    return super(RNN, self).__call__(inputs, **kwargs)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/engine/base_layer.py", line 489, in __call__
    output = self.call(inputs, **kwargs)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/layers/recurrent.py", line 1691, in call
    initial_state=initial_state)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/layers/recurrent.py", line 682, in call
    input_length=timesteps)
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 3105, in rnn
    targets=[last_output])
  File "/home/jnickel/src/mycroft-precise/.venv/lib/python3.7/site-packages/tensorflow/python/keras/utils/tf_utils.py", line 120, in get_reachable_from_inputs
    raise TypeError('Expected Operation, Variable, or Tensor, got ' + str(x))
TypeError: Expected Operation, Variable, or Tensor, got 0