Comments (7)
@gvskalyan, knowledge distillation is indeed in the works. Note also that shared embeddings are already an option for the transformer architecture [1]. We don't have immediate plans to add average attention, but we suggest looking at the hybrid architecture [2], which in the same spirit (faster inference for transformer models).
[1]
translate/pytorch_translate/transformer.py
Lines 159 to 171 in 7752ad7
[2]
from translate.
export should be doable on CPU. Note that none of our ONNX tests require GPU: https://github.com/pytorch/translate/blob/master/pytorch_translate/test/test_onnx.py
whereas training DOES require GPU: https://github.com/pytorch/translate/blob/master/pytorch_translate/test/test_train.py
Tests which require GPU have this decorator @unittest.skipIf(torch.cuda.device_count() < 1, "No GPU available for test.")
from translate.
the build fails at make 2>&1 | tee MAKE_OUT
with the log ::
Scanning dependencies of target translation_decoder
[ 16%] Building CXX object CMakeFiles/translation_decoder.dir/Decoder.cpp.o
In file included from /home/local/usr/miniconda3/envs/pytrans/include/caffe2/core/logging.h:12:0,
from /home/local/usr/miniconda3/envs/pytrans/include/caffe2/core/init.h:6,
from /home/local/usr/translate/pytorch_translate/cpp/Decoder.cpp:32:
/home/local/usr/miniconda3/envs/pytrans/include/caffe2/proto/caffe2.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
Please help @liezl200
According to this BVLC/caffe#5645 uninstall libprotobuf in conda installed, solves it, but the pytorch+caffe2 also gets uninstalled with it .
These are exactly the steps I follow :: (I just need to export a fairseq trained translation model to onnx on CPU)
git clone https://github.com/pytorch/translate.git
pushd translate
conda install -y -c caffe2 pytorch-caffe2
conda install -y numpy==1.14 --no-deps
export CONDA_PATH="$(dirname $(which conda))/.."
git clone --recursive https://github.com/onnx/onnx.git
yes | pip install ./onnx 2>&1 | tee ONNX_OUT
pip uninstall -y pytorch-translate
python3 setup.py build develop
pushd pytorch_translate/cpp
mkdir build && pushd build
cmake
-DCMAKE_PREFIX_PATH="${CONDA_PATH}/usr/local"
-DCMAKE_INSTALL_PREFIX="${CONDA_PATH}" ..
2>&1 | tee CMAKE_OUT
from translate.
Is there average attention, shared embeddings, knowledge distillation under works as the Marian-NMT people do? @liezl200
from translate.
I am still unable to make build due to the above error.
from translate.
I am still unable to make build due to the above error.
I had the same problem. Python 3.6 degrades to 2.7.
from translate.
@FuKaiYin You could try training the model in translate itself and use the docker image to export the model that might it!
from translate.
Related Issues (20)
- Hybrid model performance HOT 1
- Syntax Error while running the training command HOT 1
- Training Knowledge distillation with model trained on Fairseq HOT 1
- ONNX export not working HOT 5
- Unable to import onxx
- Exporting model status
- pytorch
- While running pretrained model(IWSLT 2014) , observed below errors HOT 4
- Cannot import 'latent_var_criterion' HOT 1
- How can I export a single Onnx?
- No more libcaffe2.so to link
- Are there any example of deep fusion? HOT 1
- nccl no more downloadable
- NameError: name 'LevenshteinTransformerModel' is not defined HOT 3
- unrecognized arguments: --batched-beam
- beam search HOT 2
- depricated functions HOT 4
- obtain alignment/attention information HOT 1
- Cannot load pretrained model HOT 1
- Replacing Hardswish to alternative activation function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translate.