Ubuntu(18.04)에 tensorflow 설치
➢Tensorflow를 설치하기 전 ubuntu를 업데이트와 업그레이드 해준다.
$ sudo apt-get update
$ sudo apt-get upgrade
➢OpenCV 설치
$ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
$ sudo apt-get install libxvidcore-dev libx264-dev
$ pip3 install opencv-python
➢Tensorflow설치 및 PATH설정
$ pip3 install tensorflow
$ mkdir tensorflow1
$ cd tensorflow1
$ git clone --recurse-submodules https://github.com/tensorflow/models.git
$ sudo nano ~/.bashrc
마지막 줄에
export PYTHONPATH=$PYTHONPATH:/home/user/tensorflow1/models/research:/home/user/tensorflow1/models/research/slim
추가
➢Protobuf
tensorflow1/models/research에서 실행
$ protoc --python_out=. .\object_detection\protos\anchor_generator.proto .\object_detection\protos\argmax_matcher.proto .\object_detection\protos\bipartite_matcher.proto .\object_detection\protos\box_coder.proto .\object_detection\protos\box_predictor.proto .\object_detection\protos\eval.proto .\object_detection\protos\faster_rcnn.proto .\object_detection\protos\faster_rcnn_box_coder.proto .\object_detection\protos\grid_anchor_generator.proto .\object_detection\protos\hyperparams.proto .\object_detection\protos\image_resizer.proto .\object_detection\protos\input_reader.proto .\object_detection\protos\losses.proto .\object_detection\protos\matcher.proto .\object_detection\protos\mean_stddev_box_coder.proto .\object_detection\protos\model.proto .\object_detection\protos\optimizer.proto .\object_detection\protos\pipeline.proto .\object_detection\protos\post_processing.proto .\object_detection\protos\preprocessor.proto .\object_detection\protos\region_similarity_calculator.proto .\object_detection\protos\square_box_coder.proto .\object_detection\protos\ssd.proto .\object_detection\protos\ssd_anchor_generator.proto .\object_detection\protos\string_int_label_map.proto .\object_detection\protos\train.proto .\object_detection\protos\keypoint_box_coder.proto .\object_detection\protos\multiscale_anchor_generator.proto .\object_detection\protos\graph_rewriter.proto
$ python3 setup.py build
$ python3 setup.py install
⌗ https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 참고하였다.
⌗ 설치를 오래전에 하였으며 설치가 안되는 일이 있으면 구글링하며 설치하여 모호하다.
$ sudo apt-get update
$ sudo apt-get upgrade
➢OpenCV 설치
$ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
$ sudo apt-get install libxvidcore-dev libx264-dev
$ pip3 install opencv-python
➢Tensorflow설치 및 PATH설정
$ pip3 install tensorflow
$ mkdir tensorflow1
$ cd tensorflow1
$ git clone --recurse-submodules https://github.com/tensorflow/models.git
$ sudo nano ~/.bashrc
마지막 줄에
export PYTHONPATH=$PYTHONPATH:/home/user/tensorflow1/models/research:/home/user/tensorflow1/models/research/slim
추가
➢Protobuf
tensorflow1/models/research에서 실행
$ protoc --python_out=. .\object_detection\protos\anchor_generator.proto .\object_detection\protos\argmax_matcher.proto .\object_detection\protos\bipartite_matcher.proto .\object_detection\protos\box_coder.proto .\object_detection\protos\box_predictor.proto .\object_detection\protos\eval.proto .\object_detection\protos\faster_rcnn.proto .\object_detection\protos\faster_rcnn_box_coder.proto .\object_detection\protos\grid_anchor_generator.proto .\object_detection\protos\hyperparams.proto .\object_detection\protos\image_resizer.proto .\object_detection\protos\input_reader.proto .\object_detection\protos\losses.proto .\object_detection\protos\matcher.proto .\object_detection\protos\mean_stddev_box_coder.proto .\object_detection\protos\model.proto .\object_detection\protos\optimizer.proto .\object_detection\protos\pipeline.proto .\object_detection\protos\post_processing.proto .\object_detection\protos\preprocessor.proto .\object_detection\protos\region_similarity_calculator.proto .\object_detection\protos\square_box_coder.proto .\object_detection\protos\ssd.proto .\object_detection\protos\ssd_anchor_generator.proto .\object_detection\protos\string_int_label_map.proto .\object_detection\protos\train.proto .\object_detection\protos\keypoint_box_coder.proto .\object_detection\protos\multiscale_anchor_generator.proto .\object_detection\protos\graph_rewriter.proto
$ python3 setup.py build
$ python3 setup.py install
⌗ https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 참고하였다.
⌗ 설치를 오래전에 하였으며 설치가 안되는 일이 있으면 구글링하며 설치하여 모호하다.
댓글
댓글 쓰기