在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:lingvo开源软件地址:https://gitee.com/mirrors/lingvo开源软件介绍:LingvoWhat is it?Lingvo is a framework for building neural networks in Tensorflow, particularlysequence models. A list of publications using Lingvo can be found here. Table of ContentsReleases
Older releases
Details for older releases are unavailable. Major breaking changesNOTE: this is not a comprehensive list. Lingvo releases do not offer anyguarantees regarding backwards compatibility. HEADNothing here. 0.11.0
0.10.0
0.9.1
0.9.0
Older releases0.8.2
Details for older releases are unavailable. Quick startInstallationThere are two ways to set up Lingvo: installing a fixed version through pip, orcloning the repository and building it with bazel. Docker configurations areprovided for each case. If you would just like to use the framework as-is, it is easiest to just installit through pip. This makes it possible to develop and train custom models usinga frozen version of the Lingvo framework. However, it is difficult to modify theframework code or implement new custom ops. If you would like to develop the framework further and potentially contributepull requests, you should avoid using pip and clone the repository instead. pip: The Lingvo pip package can be installed with See thecodelabfor how to get started with the pip package. From sources: The prerequisites are:
Refer to docker/dev.dockerfile for a set of workingrequirements.
docker: Docker configurations are available for both situations. Instructions can befound in the comments on the top of each file.
Running the MNIST image modelPreparing the input datapip: mkdir -p /tmp/mnistpython3 -m lingvo.tools.keras2ckpt --dataset=mnist bazel: mkdir -p /tmp/mnistbazel run -c opt //lingvo/tools:keras2ckpt -- --dataset=mnist The following files will be created in
Running the modelpip: cd /tmp/mnistcurl -O https://raw.githubusercontent.com/tensorflow/lingvo/master/lingvo/tasks/image/params/mnist.pypython3 -m lingvo.trainer --run_locally=cpu --mode=sync --model=mnist.LeNet5 --logdir=/tmp/mnist/log bazel: (cpu) bazel build -c opt //lingvo:trainer(gpu) bazel build -c opt --config=cuda //lingvo:trainerbazel-bin/lingvo/trainer --run_locally=cpu --mode=sync --model=image.mnist.LeNet5 --logdir=/tmp/mnist/log --logtostderr After about 20 seconds, the loss should drop below 0.3 and a checkpoint will besaved, like below. Kill the trainer with Ctrl+C. trainer.py:518] step: 205, steps/sec: 11.64 ... loss:0.25747201 ...checkpointer.py:115] Save checkpointcheckpointer.py:117] Save checkpoint done: /tmp/mnist/log/train/ckpt-00000205 Some artifacts will be produced in
As well as in
Now, let's evaluate the model on the "Test" dataset. In the normal trainingsetup the trainer and evaler should be run at the same time as two separateprocesses. pip: python3 -m lingvo.trainer --job=evaler_test --run_locally=cpu --mode=sync --model=mnist.LeNet5 --logdir=/tmp/mnist/log bazel: bazel-bin/lingvo/trainer --job=evaler_test --run_locally=cpu --mode=sync --model=image.mnist.LeNet5 --logdir=/tmp/mnist/log --logtostderr Kill the job with Ctrl+C when it starts waiting for a new checkpoint. base_runner.py:177] No new check point is found: /tmp/mnist/log/train/ckpt-00000205 The evaluation accuracy can be found slightly earlier in the logs. base_runner.py:111] eval_test: step: 205, acc5: 0.99775392, accuracy: 0.94150388, ..., loss: 0.20770954, ... Running the machine translation modelTo run a more elaborate model, you'll need a cluster with GPUs. Please refer to Running the GShard transformer based giant language modelTo train a GShard language model with one trillion parameters on GCP usingCloudTPUs v3-512 using 512-way model parallelism, please refer to Running the 3d object detection modelTo run the StarNet model using CloudTPUs on GCP, please refer to ModelsAutomatic Speech Recognition
Car
Image
Language Modelling
Machine Translation
ReferencesPlease cite this paper when referencingLingvo. @misc{shen2019lingvo, title={Lingvo: a Modular and Scalable Framework for Sequence-to-Sequence Modeling}, author={Jonathan Shen and Patrick Nguyen and Yonghui Wu and Zhifeng Chen and others}, year={2019}, eprint={1902.08295}, archivePrefix={arXiv}, primaryClass={cs.LG}} License |
请发表评论