GithubHelp home page GithubHelp logo

Python version degrades about translate HOT 7 CLOSED

pytorch avatar pytorch commented on July 16, 2024
Python version degrades

from translate.

Comments (7)

jhcross avatar jhcross commented on July 16, 2024 1

@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]

parser.add_argument(
"--share-decoder-input-output-embed",
default=False,
action="store_true",
help="share decoder input and output embeddings",
)
parser.add_argument(
"--share-all-embeddings",
default=False,
action="store_true",
help="share encoder, decoder and output embeddings"
" (requires shared dictionary and embed dim)",
)

[2]

class HybridTransformerRNNModel(FairseqModel):

from translate.

liezl200 avatar liezl200 commented on July 16, 2024

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.

kalyangvs avatar kalyangvs commented on July 16, 2024

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.

kalyangvs avatar kalyangvs commented on July 16, 2024

Is there average attention, shared embeddings, knowledge distillation under works as the Marian-NMT people do? @liezl200

from translate.

kalyangvs avatar kalyangvs commented on July 16, 2024

I am still unable to make build due to the above error.

from translate.

FYVictor93 avatar FYVictor93 commented on July 16, 2024

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.

kalyangvs avatar kalyangvs commented on July 16, 2024

@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)

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.