1 環(huán)境配置
- 使用anaconda新建一個(gè)虛擬環(huán)境
$ conda create -n mace python=3.6
- 安裝Python依賴
pip install jinja2==2.10
pip install pyyaml==3.12
pip install sh==1.12.14
pip install numpy==1.14.0
pip install six==1.11.0
pip install filelock
pip install google
pip install protobuf
pip install tensorflow==1.8.0
- 安裝CMake
wget http://www.cmake.org/files/v3.11/cmake-3.11.3.tar.gz
tar xf cmake-3.11.3.tar.gz
cd cmake-3.11.3
./configure
sudo make
sudo make install
ln -sf your_cmake3.11.3_path/bin/* /usr/bin/
cmake --version
cmake version 3.11.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
2 拉取代碼
git clone https://github.com/XiaoMi/mace.git
git clone https://github.com/XiaoMi/mace-models.git
3 模型轉(zhuǎn)換
python tools/converter.py convert --config=../mace-models/realtime-style-transfer/realtime_style_transfer_wreck.yml
4 安卓部署
見https://zhuanlan.zhihu.com/p/66662510