GithubHelp home page GithubHelp logo

delta-ml / delta Goto Github PK

View Code? Open in Web Editor NEW
1.6K 1.6K 295.0 60.97 MB

DELTA is a deep learning based natural language and speech processing platform.

Home Page: https://delta-didi.readthedocs.io/

License: Apache License 2.0

Vim Script 0.11% Python 60.12% Shell 8.85% Makefile 0.77% C++ 23.48% C 0.63% Assembly 0.08% PHP 0.13% Perl 2.55% Go 0.85% Dockerfile 0.01% CMake 1.00% Cuda 1.41%
asr custom-ops deep-learning emotion-recognition front-end inference nlp nlu ops seq2seq sequence-to-sequence serving speaker-verification speech speech-recognition tensorflow tensorflow-lite tensorflow-serving text-classification text-generation

delta's People

Contributors

0xflotus avatar applenob avatar barius avatar cambricon42 avatar garygao99 avatar guo-t-w avatar hankun11 avatar itamaker avatar luffywalf avatar mabaochang avatar madrugado avatar saduras avatar saga92 avatar songyuzhou1985 avatar xhyandwyy avatar zh794390558 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delta's Issues

Loss of so Library:x_ops.so

ERROR:
tensorflow.python.framework.errors_impl.NotFoundError: /home/delta/delta/layers/ops/x_ops.so: cannot open shared object file: No such file or directory

using conda and pip to instal tensorflow as default

Is your feature request related to a problem? Please describe.
using conda+pip to install tensorflow, and also fix README.md

Describe the solution you'd like
N/A.

Describe alternatives you've considered

Additional context
arcface loss unit test not pass using conda to install tensorflow, beacuse number precision which caused by Tensorflow Compile Flags. conda may re-compile tensorflow for source by itself and not support some SIMD for linux x86.

Use full memory of only 1 GPU inspite of having 3 GPUS.

Hello,

I am trying to run the seq2seq model available in the example section. Model can detect all the gpus (3) as shown here:

2019-11-28 15:26:55.790478: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0, 1, 2
2019-11-28 15:26:55.790786: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-11-28 15:26:55.790800: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0 1 2
2019-11-28 15:26:55.790808: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N Y Y
2019-11-28 15:26:55.790813: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 1: Y N Y
2019-11-28 15:26:55.790819: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 2: Y Y N

In spite of that model consumes only memory of 1 gpu as shown here:
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 357088 C python3 23427MiB |
| 1 357088 C python3 163MiB |
| 2 357088 C python3 163MiB |
+-----------------------------------------------------------------------------+

Please let me know, where should I do changes, to use full GPU memory usage.

Thanks in advance

Fail to load model for iemocap evaluation.

Describe the bug
When trying to run an evaluation run with the iemocap example after training a model it fails with:

Traceback (most recent call last):
  File "../../delta/delta/main.py", line 111, in <module>
    app.run(main)
  File "/home/david175/miniconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/david175/miniconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "../../delta/delta/main.py", line 81, in main
    solver.eval()
  File "/home/david175/project/delta/delta/utils/solver/emotion_solver.py", line 132, in eval
    self.model_fn(mode=utils.EVAL)
  File "/home/david175/project/delta/delta/utils/solver/asr_solver.py", line 193, in model_fn
    self.model.load_weights(str(model_path))
  File "/home/david175/miniconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 162, in load_weights
    return super(Model, self).load_weights(filepath, by_name)
  File "/home/david175/miniconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/keras/engine/network.py", line 1424, in load_weights
    saving.load_weights_from_hdf5_group(f, self.layers)
  File "/home/david175/miniconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 737, in load_weights_from_hdf5_group
    ' layers.')
ValueError: You are trying to load a weight file containing 3 layers into a model with 0 layers.

To Reproduce
Requires full installation of delta & iemocap dataset. Steps to reproduce the behavior:

  1. Set root path to iemocap dataset in egs/iemocap/emo/v1/run.sh
  2. For faster repro set epochs to 1 in egs/iemocap/emo/v1/conf/emo-keras-blstm.yml
  3. Change to directory egs/iemocap/emo/v1
  4. Run ./run.sh
  5. After training run 'python3 -u ../../../../delta/main.py --cmd eval --config conf/emo-keras-blstm.yml'
  6. See error

Expected behavior
The evaluation runs without errors.

Additional Information
Tried it with keras 2.2.4 and 2.1.0. Both produce the same error.

unify delta and deltann dockerfile

Is your feature request related to a problem? Please describe.
Unify delta and deltann docker image, using one image.
Supoort gpu and cpu.
Compile and install tensorflow from source.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

add apply_local_cmvn unit test

def apply_local_cmvn(feats, epsilon=1e-9) does not have unit test.

Describe the solution you'd like
add unit test.

Describe alternatives you've considered
N/A

Additional context
N/A

add alpha param for focal loss

Is your feature request related to a problem? Please describe.
SATT

Describe the solution you'd like

Describe alternatives you've considered

Additional context

HTTP server for deltann

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
Support RESTfull API same to TF-Serving, using golang.

Describe alternatives you've considered
Compile go bins under docker.
using go deps to organize packages.

Additional context

How could I run the service?

Hi all, thank you for open this project.

I want to run the deployment.

The readme says:

  • Use scripts under dpl/gadapter to convert model to other deployment model.

But I didn't find any scripts in the folder.

Could you show the details? Thx!

运行nlu_joint 出错

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
    设置nlu_joint.yaml 中optimizer->multitask为True
  2. Click on '....'
    run main.py
  3. Scroll down to '....'
    [ 2019-09-11 20:43:19,674 INFO base_solver.py:239 11187 ] Using multi-task optimizer
    Traceback (most recent call last):
    File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 297, in assert_same_structure
    expand_composites)
    ValueError: The two structures don't have the same nested structure.

First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)

Second structure: type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))

More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2001, in cond
nest.assert_same_structure(orig_res_t, orig_res_f, expand_composites=True)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 304, in assert_same_structure
% (str(e), str1, str2))
ValueError: The two structures don't have the same nested structure.

First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)

Second structure: type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))

More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
Entire first structure:
.
Entire second structure:
.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gallup/study/nlp/photon/main.py", line 114, in
app.run(main)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "/home/gallup/study/nlp/photon/main.py", line 82, in main
solver.train_and_eval()
File "/home/gallup/study/nlp/photon/utils/solver/raw_solver.py", line 420, in train_and_eval
global_step)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 339, in get_train_op
global_step)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 290, in get_apply_gradients_op
grads_and_vars = self.clip_gradients(grads_and_vars, global_norm, multitask)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 269, in clip_gradients
grads_and_vars, clip_ratio)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 139, in clip_gradients_by_global_norm
nonzero_gradients = [_replace_nonexisting_grad(g) for g in gradients]
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 139, in
nonzero_gradients = [_replace_nonexisting_grad(g) for g in gradients]
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 137, in _replace_nonexisting_grad
lambda: grad)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2007, in cond
"Incompatible return values of true_fn and false_fn: {}".format(e))
ValueError: Incompatible return values of true_fn and false_fn: The two structures don't have the same nested structure.

First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)

Second structure: type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))

More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
Entire first structure:
.
Entire second structure:
4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Improve speaker model performance.

3 smaller issues:

  1. When remove_last_nonlinearity: true in config file, there won't be any dropout in embedding layers. This breaks consistency with older models.

  2. According to researches, dropout in embedding layers (or the whole network) has no benefit for embedding learning. So we'll remove them.

  3. Test Adam + L2.

AttributeError: 'JointBilstmCrfModel' object has no attribute '_trainable_weights'

Describe the bug
A clear and concise description of what the bug is.
in tf1.12, run python main.py --cmd train --config ../egs/atis2/nlu_joint/v1/config/nlu_joint.yml ,AttributeError: 'JointBilstmCrfModel' object has no attribute '_trainable_weights'
To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
    AttributeError: 'JointBilstmCrfModel' object has no attribute '_trainable_weights'
    Expected behavior
    A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] ubuntu 18.04
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

can not auto build docker images

Building in Docker Cloud's infrastructure...
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '140.82.113.4' to the list of known hosts.
fatal: no submodule mapping found in .gitmodules for path 'egs/conll2003/pretrain/v1/local/bilm'
please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (128)

refs:
https://docs.docker.com/docker-hub/builds/link-source/
docker/hub-feedback#416
docker/hub-feedback#213
docker/hub-feedback#633

Undefined names: missing imports?

flake8 testing of https://github.com/didi/delta on Python 3.7.1

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./egs/iemocap/emo/v1/local/python/features.py:328:19: F821 undefined name 'plt'
        fig, ax = plt.subplots()
                  ^
./egs/iemocap/emo/v1/local/python/features.py:332:19: F821 undefined name 'plt'
        imgplot = plt.imshow(chromaGramToPlot)
                  ^
./egs/iemocap/emo/v1/local/python/features.py:345:9: F821 undefined name 'plt'
        plt.colorbar()
        ^
./egs/iemocap/emo/v1/local/python/features.py:346:9: F821 undefined name 'plt'
        plt.show()
        ^
./egs/iemocap/emo/v1/local/python/features.py:361:15: F821 undefined name 'lpc'
    A, e, k = lpc(x1, ncoeff)    
              ^
./egs/iemocap/emo/v1/local/python/features.py:393:21: F821 undefined name 'utilities'
        [pos1, _] = utilities.peakdet(stFeatures[i, :], DifThres)           # detect local maxima
                    ^
./egs/iemocap/emo/v1/local/python/features.py:402:13: F821 undefined name 'plt'
            plt.subplot(9, 2, ii + 1)
            ^
./egs/iemocap/emo/v1/local/python/features.py:403:13: F821 undefined name 'plt'
            plt.plot(stFeatures[i, :], 'k')
            ^
./egs/iemocap/emo/v1/local/python/features.py:405:17: F821 undefined name 'plt'
                plt.plot(k, stFeatures[i, k], 'k*')
                ^
./egs/iemocap/emo/v1/local/python/features.py:406:18: F821 undefined name 'plt'
            f1 = plt.gca()
                 ^
./egs/iemocap/emo/v1/local/python/features.py:411:9: F821 undefined name 'plt'
        plt.show(block=False)
        ^
./egs/iemocap/emo/v1/local/python/features.py:412:9: F821 undefined name 'plt'
        plt.figure()
        ^
./egs/iemocap/emo/v1/local/python/features.py:426:9: F821 undefined name 'plt'
        plt.plot(BPMs, HistAll, 'k')
        ^
./egs/iemocap/emo/v1/local/python/features.py:427:9: F821 undefined name 'plt'
        plt.xlabel('Beats per minute')
        ^
./egs/iemocap/emo/v1/local/python/features.py:428:9: F821 undefined name 'plt'
        plt.ylabel('Freq Count')
        ^
./egs/iemocap/emo/v1/local/python/features.py:429:9: F821 undefined name 'plt'
        plt.show(block=True)
        ^
./egs/iemocap/emo/v1/local/python/features.py:478:19: F821 undefined name 'plt'
        fig, ax = plt.subplots()
                  ^
./egs/iemocap/emo/v1/local/python/features.py:479:19: F821 undefined name 'plt'
        imgplot = plt.imshow(specgram.transpose()[::-1, :])
                  ^
./egs/iemocap/emo/v1/local/python/features.py:493:9: F821 undefined name 'plt'
        plt.colorbar()
        ^
./egs/iemocap/emo/v1/local/python/features.py:494:9: F821 undefined name 'plt'
        plt.show()
        ^
./egs/iemocap/emo/v1/local/python/features.py:706:19: F821 undefined name 'audioBasicIO'
        [Fs, x] = audioBasicIO.readAudioFile(wavFile)            # read file
                  ^
./egs/iemocap/emo/v1/local/python/features.py:708:13: F821 undefined name 'audioBasicIO'
        x = audioBasicIO.stereo2mono(x)                          # convert stereo to mono
            ^
./egs/iemocap/emo/v1/local/python/features.py:784:19: F821 undefined name 'audioBasicIO'
        [Fs, x] = audioBasicIO.readAudioFile(wavFile)            # read file
                  ^
./egs/iemocap/emo/v1/local/python/features.py:785:13: F821 undefined name 'audioBasicIO'
        x = audioBasicIO.stereo2mono(x)                          # convert stereo to mono
            ^
./egs/iemocap/emo/v1/local/python/features.py:815:15: F821 undefined name 'audioBasicIO'
    [Fs, x] = audioBasicIO.readAudioFile(fileName)            # read the wav file
              ^
./egs/iemocap/emo/v1/local/python/features.py:816:9: F821 undefined name 'audioBasicIO'
    x = audioBasicIO.stereo2mono(x)                           # convert to MONO if required
        ^
./delta/layers/transformer.py:248:7: F821 undefined name 'logging'
      logging.error(error_info)
      ^
./delta/data/task/speech_cls_task.py:724:39: F821 undefined name 'feat'
            soft_label = self.teacher(feat)
                                      ^
28    F821 undefined name 'feat'
28

deployment compile error

Describe the bug
run 'run.sh' in directory dpl. Error occurs when compiling deltann.

Screenshots
image

what's the matter ?
Additional context
It's better to provide demos about how to deployment. Do you have the plan?

register error for tf2.x

Describe the bug
from delta.layers.base_layer import Layer
will raise error:
"Registering two gradient with name 'BlockLSTM'!

caused by from delta.layers.recurrent import RnnAttentionEncoder

To Reproduce
under delta/delta/models
python autoencoder_model_test.py

Screenshots

Traceback (most recent call last):
  File "autoencoder_model_test.py", line 35, in setUp
    import_all_modules_for_register_v2()
  File "/workbase/delta/delta/utils/register.py", line 181, in import_all_modules_for_register_v2
    importlib.import_module(full_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/workbase/delta/delta/models/autoencoder_model.py", line 25, in <module>
    from delta.layers.base_layer import Layer
  File "/workbase/delta/delta/layers/__init__.py", line 19, in <module>
    from delta.layers.recurrent import RnnAttentionEncoder
  File "/workbase/delta/delta/layers/recurrent.py", line 23, in <module>
    from tensorflow.contrib import seq2seq
  File "/root/.local/lib/python3.6/site-packages/tensorflow/contrib/__init__.py", line 37, in <module>
    from tensorflow.contrib import cudnn_rnn
  File "/root/.local/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/__init__.py", line 38, in <module>
    from tensorflow.contrib.cudnn_rnn.python.layers import *
  File "/root/.local/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/python/layers/__init__.py", line 23, in <module>
    from tensorflow.contrib.cudnn_rnn.python.layers.cudnn_rnn import *
  File "/root/.local/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py", line 20, in <module>
    from tensorflow.contrib.cudnn_rnn.python.ops import cudnn_rnn_ops
  File "/root/.local/lib/python3.6/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py", line 22, in <module>                                                                                                                               
    from tensorflow.contrib.rnn.python.ops import lstm_ops
  File "/root/.local/lib/python3.6/site-packages/tensorflow/contrib/rnn/__init__.py", line 91, in <module>
    from tensorflow.contrib.rnn.python.ops.lstm_ops import *
  File "/root/.local/lib/python3.6/site-packages/tensorflow/contrib/rnn/python/ops/lstm_ops.py", line 298, in <module>
    @ops.RegisterGradient("BlockLSTM")
  File "/root/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 2489, in __call__
    _gradient_registry.register(f, self._op_type)
  File "/root/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/registry.py", line 61, in register
    (self._name, name, function_name, filename, line_number))
KeyError: "Registering two gradient with name 'BlockLSTM'! (Previous registration was in register /root/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/registry.py:66)"                                                                   

----------------------------------------------------------------------
Ran 2 tests in 0.216s

FAILED (errors=1)

Additional context
test under delta docker

move arcface_loss to loss_utils

Describe the solution you'd like
Moving def arcface_loss to utils and support weights from outer and create inner.
And also add unit test.

Describe alternatives you've considered
N/A

Additional context
N/A

Kaldi-Like Front End

mfcc[done]
make_mfcc.sh[done]
compute-cmvn-stats[done]
apply-cmvn[done]
make_stft.sh[done]
One Entry Point Like espnet transform
copy-feat[done]
extract spec and phase from wav[done]
convert spec and phase to wav[done]

pitch
plp

docs for the interface

安装./install/install-delta.sh nlp cpu报错

SSLError(MaxRetryError('HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/noarch/repodata.json.bz2 (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')",),))',),)
这个怎么解决

如何部署模型?

你好,我已经训练并导出了cnn_dailymail例子的saved_model模型,但我不知道如何部署我的模型并对外提供服务。我试图在tf-serving docker上部署,命令是docker run -d --name tf-serving -v /root/delta:/models/delta -e MODEL_NAME=delta tensorflow/serving:1.14.0,但报错。我的宿主机/root/delta目录下有我导出的saved_model模型,启动容器后查看日志,显示:tensorflow_serving/util/retrier.cc:37] Loading servable: {name: delta version: 1} failed: Not found: Op type not registered 'SentenceToIds' in binary running on hi2. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
此外,请详细帮我讲解一下如果这个text summarization例子部署成功,我该如何调用它为我返回文本摘要,上传什么参数,返回给我什么信息,部署时的model.yaml该怎么写,多谢!

refactor asr egs

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

  1. large batch size

  2. restore model from latest or specific checkpoint.

  3. refactor solver to using by asr and emo.

  4. blank index transform and doc addition.

  5. mini_an4 integration test.

  6. filter input & output length. espnet utils

  7. lookup table to convert infer token id to token, and dump as kaldi format.

  8. export saved model

Describe alternatives you've considered
N/A

Additional context
N/A

'convert model error' when converting SNLI rnn_matching.yml to TFLITE

Thank you for the very useful project.

Describe the bug

A simple error is thrown when trying to convert the snli model to tflite.

The error is:


Params:
stage: -1 - 100
TARGET: linux
ARCH: x86_64
INPUT_MODEL: /user/caleb.p/Development/delta/./dpl/model
INPUT_YAML: /user/caleb.p/Development/delta/./dpl/model/model.yaml
OUTPUT_MODEL: /user/caleb.p/Development/delta/./dpl/.gen


Input: /user/caleb.p/Development/delta/./dpl/model
Output: /user/caleb.p/Development/delta/./dpl/.gen

Convert model...
~/Development/delta/dpl/gadapter ~/Development/delta/dpl
OUTPUT_NUM: 2
OUTPUT_NAMES: ,ArgMax:0,score:0
Satrt transform graph ...
tflite to be added.
convert model error

To Reproduce
Steps to reproduce the behavior:

  1. Follow the steps in docs to train_and_eval the snli model with the config located at delta/egs/snli/match/v1/config/rnn_match.yml
  2. move the saved model to the dpl/model folder as instructed.
  3. Use the following model.yaml to convert the model
model:
  custom_ops_path: "../dpl/output/lib/custom_ops/libx_ops.so" 
  graphs:
    -
      # meta data
      id: 0
      name: "snli_encoder" # model name

      # deltann type
      server_type: "local" # local, remote
      engine: "TFLITE" # TF, TFLITE, TFTRT, TFSERVING

      # model config
      version: 1    # model version
      local:  # local run
        path: "../dpl/output/model/saved_model" # model path without version info
        model_type: "saved_model" # e.g. saved_model, frozen_graph_pb, frozen_graph_txt
      # inputs and outputs
      inputs:
        -
          id: 0
          name: "input_sent_left:0"
          shape: [-1]
          dtype: "string"
        -
          id: 1
          name: "input_sent_right:0"
          shape: [-1]
          dtype: "string"
      outputs:
        -
          id: 0
          name: "ArgMax:0"
          shape: [-1]
          dtype: "int64"
        -
          id: 1
          name: "score:0"
          shape: [-1, 3]
          dtype: "float"


runtime:
  num_threads: 20

serving:
  max_worker: 5
  max_queue: 100
  1. run ./run.sh located in dpl

Expected behavior
Deployment artifacts to be created in output folder

Desktop (please complete the following information):

  • OS: Ubuntu 18.04

Example scripts for audio missing?

Hello, thank you for the toolkit

Am I wrong to say that there are no example scripts to use Delta toolkit for audio applications?

Without an example script, it is really difficult to test your toolkit.

refactor common_layers.py and add unit test

common_layers.py

Describe the solution you'd like
For common_layers.py add unit test,
and extract common layer from speaker_cls_rawmodel.py into common_layers.py.

Describe alternatives you've considered
N/A

Additional context
N/A

Benchmark tutorials

We should add more documentation for the codebase. We will start from the tutorial for all the benchmark we have experimented https://github.com/didi/delta#benchmarks.

A tutorial on how to reproduce the results from scratch for each model is necessary. Jupyter notebook is preferred, but markdown is acceptable too.

delta infer new test file error

Describe the bug
after train_and_eval, I set a new test path, get FileNotFoundError

To Reproduce
Steps to reproduce the behavior:

  1. train_and_eval
  2. change the test path
  3. infer
    FileNotFoundError: [Errno 2] No such file or directory: '

Expected behavior
infer new test path

raw_sover get config error

in delta/utils/solver/raw_solver.py 109-110
if "{}_model_path".format(mode) in self.config["solver"]["saver"]:
model_path = self.config["saver"]["{}_model_path".format(mode)]
the second line should be
model_path = self.config["solver"]["saver"]["{}_model_path".format(mode)]

check deltann install status

Describe the bug
tools/install/install-deltann.sh logging successful when error.

To Reproduce
pushd tools/install ; bash install-deltann.sh

Expected behavior
Give real log.

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

x_ops.so: undefined symbol: _ZN10tensorflow8str_util9LowercaseEN4absl11string_viewE

Traceback (most recent call last):
File "local/generate_mock_data.py", line 19, in
from delta.data.utils.test_utils import mock_a_text_file
File "/home/xxx/study/delta/delta/data/utils/init.py", line 17, in
from delta.data.utils.common_utils import *
File "/home/xxx/study/delta/delta/data/utils/common_utils.py", line 26, in
from delta.data.preprocess.text_ops import tokenize_label
File "/home/xxx/study/delta/delta/data/preprocess/text_ops.py", line 22, in
from delta.layers.ops import py_x_ops
File "/home/xxx/study/delta/delta/layers/init.py", line 27, in
from delta.layers.common_layers import *
File "/home/xxx/study/delta/delta/layers/common_layers.py", line 22, in
from delta.data.feat import speech_ops
File "/home/xxx/study/delta/delta/data/feat/init.py", line 17, in
from delta.data.feat import speech_ops
File "/home/xxx/study/delta/delta/data/feat/speech_ops.py", line 25, in
from delta.layers.ops import py_x_ops
File "/home/xxx/study/delta/delta/layers/ops/py_x_ops.py", line 27, in
tf.compat.v1.resource_loader.get_path_to_datafile('x_ops.so'))
File "/home/xxx/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 61, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /home/xxx/study/delta/delta/layers/ops/x_ops.so: undefined symbol: _ZN10tensorflow8str_util9LowercaseEN4absl11string_viewE

No module named 'delta'

python3 delta/main.py --cmd train_and_eval --config egs/yahoo_answer/text_cls/v1/config/han-cls.yml
/home/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: 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)])
/home/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: 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/aswin/anaconda3/envs/tfgpu/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: 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)])
Traceback (most recent call last):
File "delta/main.py", line 25, in
from delta import utils
ModuleNotFoundError: No module named 'delta'

refactor speaker egs

Describe the solution you'd like
update speaker model and data pipeline, support large margin softmax.

Describe alternatives you've considered

Additional context

FE: delta_delta shape is wrong

Describe the bug
The layout of the buffer is [T, CxD].

Expected behavior
The layout of the buffer is [T, DxC].

[T, D, C]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.