Open alvations opened 2 years ago
I don't know which versions are supported, but this may be potentially helpful: https://github.com/marian-nmt/marian-dev/issues/900#issuecomment-1015127934
I did some investigation into this. It requires v3.6.0 to match sentencepiece.
https://github.com/protocolbuffers/protobuf/releases/tag/v3.6.0
I added this to my docker config to deal with it:
# Get the header files for the protobuf version that matches sentencepiece in Marian.
# e.g. if the marian build complains about the C++ define: GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3006001
# This 3006001 maps to version v3.6.1. This checkout will need to change.
RUN git clone --branch v3.6.1.3 --single-branch https://github.com/protocolbuffers/protobuf.git && \
rm -rf /usr/include/google && \
ln -s $(pwd)/protobuf/src/google /usr/include
# Get the correct version of the Protobuf Compiler.
#
# protoc-3.6.1-linux-x86_64.zip
# ├── bin
# │ └── protoc
# └── include
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip && \
unzip protoc-3.6.1-linux-x86_64.zip -d protoc && \
rm protoc-3.6.1-linux-x86_64.zip && \
mv protoc/bin/protoc $BIN
RUN git clone https://github.com/marian-nmt/marian-dev.git marian-dev
# Re-build the onnx model definitions with the correct version of
RUN cd marian-dev/src/3rd_party/onnx/protobuf && \
${BIN}/protoc onnx-ml.proto --cpp_out .
Actually, this needs the library built and linked as well.
Something like:
RUN git clone --branch v3.6.1.3 --single-branch https://github.com/protocolbuffers/protobuf.git && \
./compile-protoc.sh ./protobuf
compile-protoc.sh
#!/bin/bash
set -ex
##
# Usage: ./compile-protoc.sh ./protobuf
#
test -v BIN
# This follows the instructions from: https://github.com/protocolbuffers/protobuf/blob/v3.14.0/src/README.md
cd $1
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
make install
ldconfig # refresh shared library cache.
# Now that we're done, copy the bin.
cp ./src/protoc "${BIN}"
# Link in the includes.
ln -s $(pwd)/src/google /usr/include/google
When trying to install marian with
-DUSE_ONNX
, it didn't compile.Dependencies Installation
With a fresh ubuntu instance:
Ubuntu version:
Context
Marian version: v1.11.0
CMake command: