Open chldydgh4687 opened 4 years ago
https://www.anaconda.com/distribution/
$chmod a+x Anaconda2-2019.10-Linux-x86_64.sh
$sudo ./Anaconda2-2019.10-Linux-x86_64.sh
$pip install tensorflow-gpu==1.2.0
아나콘다 permission 관련 에러가 뜨면 #7 다음을 참고해본다.
이제 다음 링크를 따라하자. reference_link : https://mc.ai/caffe-installation-on-ubuntu-18-04-lts-python-2-7/
# opencv
$sudo apt install python-opencv
# blas
$sudo apt-get install libatlas-base-dev #Atlas
or
$sudo apt-get install libopenblas-dev #OpenBlas
# Other dependencies
$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
$ sudo apt-get install --no-install-recommends libboost-all-dev
$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
$ pip install protobuf
$ sudo apt-get install the python-dev
현재 버전 : https://github.com/BVLC/caffe.git s2vt 버전 : https://github.com/vsubhashini/caffe/tree/recurrent/examples/s2vt
$sudo apt-get install git
$git clone -b recurrent --single-branch https://github.com/vsubhashini/caffe.git
or
$git clone https://github.com/BVLC/caffe.git
OPENCV_VERSION := 3 # if you are using OpenCV 3 or above
CUDA_ARCH :=
-gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode arch=compute_50,code=sm_50 \ -gencode arch=compute_52,code=sm_52 \ -gencode arch=compute_60,code=sm_60 \ -gencode arch=compute_61,code=sm_61 \ -gencode arch=compute_61,code=compute_61
BLAS := atlas # if you’ve installed Atlas (default) or BLAS := open # if you’ve installed OpenBLAS
PYTHON_INCLUDE := /usr/include/python2.7 \ /usr/lib/python2.7/dist-packages/numpy/core/include
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib/x86_64-linux-gnu/hdf5/serial
참조링크에는 위와 같이 되있고, repo에 bashrc와 makefile을 참고하길 바란다. 해당 관련해서 경로설정을 잘못해서 cuda파일을 못찾는 오류가 많다.
$ make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/layers/hdf5_data_layer.cpp
CXX src/caffe/layers/bnll_layer.cpp
CXX src/caffe/layers/lrn_layer.cpp
CXX src/caffe/layers/log_layer.cpp
CXX src/caffe/layers/eltwise_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/batch_reindex_layer.cpp
CXX src/caffe/layers/cudnn_tanh_layer.cpp
CXX src/caffe/layers/silence_layer.cpp
CXX src/caffe/layers/infogain_loss_layer.cpp
CXX src/caffe/layers/lstm_layer.cpp
CXX src/caffe/layers/exp_layer.cpp
CXX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layers/hdf5_output_layer.cpp
CXX src/caffe/layers/recurrent_layer.cpp
CXX src/caffe/layers/euclidean_loss_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/tanh_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
CXX src/caffe/layers/prelu_layer.cpp
CXX src/caffe/layers/rnn_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/cudnn_lcn_layer.cpp
CXX src/caffe/layers/dummy_data_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
CXX src/caffe/layers/spp_layer.cpp
CXX src/caffe/layers/softmax_loss_layer.cpp
CXX src/caffe/layers/clip_layer.cpp
CXX src/caffe/layers/cudnn_deconv_layer.cpp
CXX src/caffe/layers/parameter_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/neuron_layer.cpp
CXX src/caffe/layers/cudnn_pooling_layer.cpp
CXX src/caffe/layers/crop_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/reduction_layer.cpp
CXX src/caffe/layers/softmax_layer.cpp
CXX src/caffe/layers/window_data_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/layers/lstm_unit_layer.cpp
CXX src/caffe/layers/swish_layer.cpp
CXX src/caffe/layers/im2col_layer.cpp
CXX src/caffe/layers/dropout_layer.cpp
CXX src/caffe/layers/reshape_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/inner_product_layer.cpp
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/power_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/elu_layer.cpp
CXX src/caffe/layers/cudnn_lrn_layer.cpp
CXX src/caffe/layers/relu_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/threshold_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/hinge_loss_layer.cpp
CXX src/caffe/layers/flatten_layer.cpp
CXX src/caffe/layers/tile_layer.cpp
CXX src/caffe/layers/split_layer.cpp
CXX src/caffe/layers/input_layer.cpp
CXX src/caffe/layers/filter_layer.cpp
CXX src/caffe/layers/batch_norm_layer.cpp
CXX src/caffe/layers/pooling_layer.cpp
CXX src/caffe/layers/scale_layer.cpp
CXX src/caffe/layers/bias_layer.cpp
CXX src/caffe/layers/image_data_layer.cpp
CXX src/caffe/layers/multinomial_logistic_loss_layer.cpp
CXX src/caffe/layers/mvn_layer.cpp
CXX src/caffe/layers/slice_layer.cpp
CXX src/caffe/layers/embed_layer.cpp
CXX src/caffe/layers/absval_layer.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/parallel.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/util/signal_handler.cpp
CXX src/caffe/util/insert_splits.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/upgrade_proto.cpp
CXX src/caffe/util/db_leveldb.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/io.cpp
CXX src/caffe/util/blocking_queue.cpp
CXX src/caffe/util/hdf5.cpp
CXX src/caffe/util/cudnn.cpp
CXX src/caffe/util/db_lmdb.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/blob.cpp
CXX src/caffe/syncedmem.cpp
CXX src/caffe/solvers/adam_solver.cpp
CXX src/caffe/solvers/adadelta_solver.cpp
CXX src/caffe/solvers/adagrad_solver.cpp
CXX src/caffe/solvers/rmsprop_solver.cpp
CXX src/caffe/solvers/sgd_solver.cpp
CXX src/caffe/solvers/nesterov_solver.cpp
CXX src/caffe/common.cpp
CXX src/caffe/net.cpp
NVCC src/caffe/layers/crop_layer.cu
NVCC src/caffe/layers/sigmoid_cross_entropy_loss_layer.cu
NVCC src/caffe/layers/exp_layer.cu
NVCC src/caffe/layers/dropout_layer.cu
NVCC src/caffe/layers/power_layer.cu
NVCC src/caffe/layers/base_data_layer.cu
NVCC src/caffe/layers/slice_layer.cu
NVCC src/caffe/layers/euclidean_loss_layer.cu
NVCC src/caffe/layers/filter_layer.cu
NVCC src/caffe/layers/cudnn_softmax_layer.cu
NVCC src/caffe/layers/clip_layer.cu
NVCC src/caffe/layers/cudnn_lcn_layer.cu
NVCC src/caffe/layers/inner_product_layer.cu
NVCC src/caffe/layers/cudnn_lrn_layer.cu
NVCC src/caffe/layers/hdf5_data_layer.cu
NVCC src/caffe/layers/cudnn_deconv_layer.cu
NVCC src/caffe/layers/eltwise_layer.cu
NVCC src/caffe/layers/cudnn_pooling_layer.cu
NVCC src/caffe/layers/pooling_layer.cu
NVCC src/caffe/layers/split_layer.cu
NVCC src/caffe/layers/im2col_layer.cu
NVCC src/caffe/layers/batch_norm_layer.cu
NVCC src/caffe/layers/cudnn_conv_layer.cu
NVCC src/caffe/layers/conv_layer.cu
NVCC src/caffe/layers/reduction_layer.cu
NVCC src/caffe/layers/prelu_layer.cu
NVCC src/caffe/layers/recurrent_layer.cu
NVCC src/caffe/layers/scale_layer.cu
NVCC src/caffe/layers/elu_layer.cu
NVCC src/caffe/layers/lstm_unit_layer.cu
NVCC src/caffe/layers/cudnn_relu_layer.cu
NVCC src/caffe/layers/cudnn_sigmoid_layer.cu
NVCC src/caffe/layers/embed_layer.cu
NVCC src/caffe/layers/log_layer.cu
NVCC src/caffe/layers/tile_layer.cu
NVCC src/caffe/layers/contrastive_loss_layer.cu
NVCC src/caffe/layers/tanh_layer.cu
NVCC src/caffe/layers/mvn_layer.cu
NVCC src/caffe/layers/bnll_layer.cu
NVCC src/caffe/layers/swish_layer.cu
NVCC src/caffe/layers/hdf5_output_layer.cu
NVCC src/caffe/layers/accuracy_layer.cu
NVCC src/caffe/layers/softmax_layer.cu
NVCC src/caffe/layers/absval_layer.cu
NVCC src/caffe/layers/deconv_layer.cu
NVCC src/caffe/layers/silence_layer.cu
NVCC src/caffe/layers/threshold_layer.cu
NVCC src/caffe/layers/bias_layer.cu
NVCC src/caffe/layers/sigmoid_layer.cu
NVCC src/caffe/layers/relu_layer.cu
NVCC src/caffe/layers/cudnn_tanh_layer.cu
NVCC src/caffe/layers/concat_layer.cu
NVCC src/caffe/layers/batch_reindex_layer.cu
NVCC src/caffe/layers/lrn_layer.cu
NVCC src/caffe/layers/softmax_loss_layer.cu
NVCC src/caffe/util/im2col.cu
NVCC src/caffe/util/math_functions.cu
NVCC src/caffe/solvers/adam_solver.cu
NVCC src/caffe/solvers/adagrad_solver.cu
NVCC src/caffe/solvers/nesterov_solver.cu
NVCC src/caffe/solvers/rmsprop_solver.cu
NVCC src/caffe/solvers/sgd_solver.cu
NVCC src/caffe/solvers/adadelta_solver.cu
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
CXX tools/upgrade_net_proto_binary.cpp
CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
CXX tools/caffe.cpp
CXX/LD -o .build_release/tools/caffe.bin
CXX tools/upgrade_net_proto_text.cpp
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
CXX tools/compute_image_mean.cpp
CXX/LD -o .build_release/tools/compute_image_mean.bin
CXX tools/extract_features.cpp
CXX/LD -o .build_release/tools/extract_features.bin
CXX tools/convert_imageset.cpp
CXX/LD -o .build_release/tools/convert_imageset.bin
CXX tools/upgrade_solver_proto_text.cpp
CXX/LD -o .build_release/tools/upgrade_solver_proto_text.bin
CXX examples/mnist/convert_mnist_data.cpp
CXX/LD -o .build_release/examples/mnist/convert_mnist_data.bin
CXX examples/cifar10/convert_cifar_data.cpp
CXX/LD -o .build_release/examples/cifar10/convert_cifar_data.bin
CXX examples/cpp_classification/classification.cpp
CXX/LD -o .build_release/examples/cpp_classification/classification.bin
CXX examples/siamese/convert_mnist_siamese_data.cpp
CXX/LD -o .build_release/examples/siamese/convert_mnist_siamese_data.bin
$ make pycaffe
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
touch python/caffe/proto/__init__.py
PROTOC (python) src/caffe/proto/caffe.proto
export PYTHONPATH=~/Downloads/caffe/python:$PYTHONPATH
$ python
>>>import caffe
28 #32 #33 을 차례대로 따라와주세요.
graphics driver : 2080 Ti 현 Graphics driver : 435 CUDAVERSION : 9.0 ALL PATCH CUDNN : 7.4.2