개발/insightface

m1 pytorch 설치, mxnet install in mac m1

내공얌냠 2022. 4. 25. 16:44

install

아래 링크를 참고하여 pytorch 를 설치하였다.

https://c-juhwan.github.io/posts/m1-pytorch-installation/

 

M1 맥에서 Pytorch 설치하기 - M1 Native

개요

c-juhwan.github.io

 

setting

소스를 받는다.

git clone --recursive https://github.com/deepinsight/insightface.git

 

https://github.com/deepinsight/insightface/tree/master/recognition/_datasets_

여기에 있는 MS1M-ArcFace 를 다운로드 받는다.

 

GitHub - deepinsight/insightface: State-of-the-art 2D and 3D Face Analysis Project

State-of-the-art 2D and 3D Face Analysis Project. Contribute to deepinsight/insightface development by creating an account on GitHub.

github.com

config 를 고쳐준다.

arcface_mxnet 안에 있는 sample_config.py 를 복사해서 archface_torch 로 config.py 로 변경한 후 내부 dataset 경로를 알맞게 고쳐준다. (나는 _datasets_ 폴더를 datasets 이라고 이름을 변경한 후, 안에 face_emore.zip 을 넣고 압축 해제하였다.)

/insightface/recognition/arcface_torch에서 실행한다.

하려는 찰나 텐서보드가 없다고 하네요

pip install tensorboard

disutiles관련 오류가 나서

https://github.com/pytorch/pytorch/issues/69894#issuecomment-993805355

 

AttributeError: module 'distutils' has no attribute 'version' : with setuptools 59.6.0 · Issue #69894 · pytorch/pytorch

🐛 Describe the bug # python3 -m pip install --upgrade setuptools torch tensorboard` # python3 Python 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] on linux Type "help", "copyri...

github.com

https://yjs-program.tistory.com/259

 

AttributeError: module 'distutils' has no attribute 'version'

pip install setuptools==59.5.0 이유는 모르겠지만 이게 도움이 되는 것 같다. +) 참고자료 : https://stackoverflow.com/questions/70520120/attributeerror-module-setuptools-distutils-has-no-attribute-vers..

yjs-program.tistory.com

참고하여 

pip install setuptools==59.5.0

그리고 mxnet 도 없다고 나와서

brew install cmake ninja ccache opencv
git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet
cd mxnet
cp config/darwin.cmake config.cmake

config.cmake 에 홈페이지를 참고하여 옵션을 조금 조정합니다.

cuda를 사용하는 옵션을 끄고 실행 해야했으나 처음부터 off 로 설정되어있어서 저는 따로 수정하지않았습니다.

rm -rf build
mkdir -p build && cd build
cmake ..
cmake --build .

빌드까지 완료가 되면 마지막으로 설치해줍니다..

cd python
pip install --user -e .

잘 설치되었는지 확인해줍니다.

python
import mxnet as mx
print(mx.__version__)

야호

 

References

 

https://c-juhwan.github.io/posts/m1-pytorch-installation/

 

M1 맥에서 Pytorch 설치하기 - M1 Native

개요

c-juhwan.github.io

https://github.com/deepinsight/insightface/tree/master/recognition/_datasets_

 

GitHub - deepinsight/insightface: State-of-the-art 2D and 3D Face Analysis Project

State-of-the-art 2D and 3D Face Analysis Project. Contribute to deepinsight/insightface development by creating an account on GitHub.

github.com

https://mxnet.apache.org/versions/1.9.0/get_started/osx_setup

 

OSX Setup

A flexible and efficient library for deep learning.

mxnet.apache.org

 

728x90
반응형