-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive] #36
Comments
@sde123 The mpi version is too old. To install a newer version, please download the source from here, then tar xf openmpi-1.10.7.tar.gz
cd openmpi-1.10.7
./configure --with-cuda=/usr/local/cuda --enable-mpi-thread-multiple
make -j8
sudo make install
cd - This will by default install it to export PATH=/usr/local/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH Restart the terminal, |
@Cysu
|
@sde123 This means the training failed. Have you compiled the caffe successfully with the new openmpi? |
I have make the caffe successdfully the following Makefile.config: Refer to http://caffe.berkeleyvision.org/installation.htmlContributions simplifying and improving our build system are welcome!cuDNN acceleration switch (uncomment to build with cuDNN).USE_CUDNN := 1MPI data parallelization switch (uncomment to build with MPI).USE_MPI := 1 CPU-only switch (uncomment to build without GPU support).CPU_ONLY := 1To customize your choice of compiler, uncomment and set the following.N.B. the default for Linux is g++ and the default for OSX is clang++CUSTOM_CXX := g++CUDA directory contains bin/ and lib/ directories that we need.CUDA_DIR := /usr/local/cuda On Ubuntu 14.04, if cuda tools are installed via"sudo apt-get install nvidia-cuda-toolkit" then use this instead:CUDA_DIR := /usrCUDA architecture setting: going with all of them.For CUDA < 6.0, comment the *_50 lines for compatibility.CUDA_ARCH := -gencode arch=compute_20,code=sm_20 BLAS choice:atlas for ATLAS (default)mkl for MKLopen for OpenBlasBLAS := atlas Custom (MKL/ATLAS/OpenBLAS) include and lib directories.Leave commented to accept the defaults for your choice of BLAS(which should work)!BLAS_INCLUDE := /path/to/your/blasBLAS_LIB := /path/to/your/blasHomebrew puts openblas in a directory that is not on the standard search pathBLAS_INCLUDE := $(shell brew --prefix openblas)/includeBLAS_LIB := $(shell brew --prefix openblas)/libThis is required only if you will compile the matlab interface.MATLAB directory should contain the mex binary in /bin.MATLAB_DIR := /usr/local/MATLAB/R2014a MATLAB_DIR := /Applications/MATLAB_R2012b.appNOTE: this is required only if you will compile the python interface.We need to be able to find Python.h and numpy/arrayobject.h.PYTHON_INCLUDE := /usr/include/python2.7 Anaconda Python distribution is quite popular. Include path:Verify anaconda location, sometimes it's in root.ANACONDA_HOME := $(HOME)/anacondaPYTHON_INCLUDE := $(ANACONDA_HOME)/include \
We need to be able to find libpythonX.X.so or .dylib.PYTHON_LIB := /usr/local/lib PYTHON_LIB := $(ANACONDA_HOME)/libHomebrew installs numpy in a non standard path (keg only)PYTHON_INCLUDE +=
|
@sde123 Yeah, I know the Makefile.config. I mean are there any errors when you run A tip: when copy and paste something, please use the following syntax to wrap the content, for example, ``` This will make it much more readable. |
@Cysu
|
@Cysu
|
Could you please check the outputs of the following commands ldd external/caffe/build/tools/caffe | grep mpi
which mpi
mpirun --version
echo $LD_LIBRARY_PATH |
Thank you,I check the commands and got the following information dai@dai-System-Product-Name:~/code/person_reidentification/3/dgd_person_reid$ which mpi dai@dai-System-Product-Name:~/code/person_reidentification/3/dgd_person_reid$ mpirun --version Report bugs to http://www.open-mpi.org/community/help/ |
@Cysu |
@sde123 Sorry for my typo, it should be ldd external/caffe/build/tools/caffe | grep mpi Please use ``` (the tilde character left to number 1 on keyboard) instead of ... when paste the content. Thanks. |
@Cysu
I donnot know what is wrong in my case. the following is my mpi:
Thank you |
@sde123 The command should be ldd external/caffe/build/tools/caffe | grep mpi Note that it is By the way, what's your GPU memory size? |
@Cysu
So ,I make the caffe again,I got a measage when run make runtest -j8 in external/caffe:
Did it mean that my external/caffe is wrong? |
@Cysu |
Could you please first check that the following commands report the same library paths? ldd $(which mpirun) | grep mpi
ldd external/caffe/build/tools/caffe | grep mpi |
@Cysu
why I got no report with inputting "ldd $(which mpirun) | grep mpi" to the terminal. I have install mpi ,and I can find it in the usr/local/lib and usr/local/include. |
Sorry, my fault. It should be ldd $(which mpirun) | grep open-
ldd external/caffe/build/tools/caffe | grep open- |
@Cysu
and I got the report:
I input the
and got the report:
the two report are almost same |
Yes, that means the mpi are configured correctly. Could you please show the output of |
@Cysu
Thankyou very much for your code on person re_identification
I have install openmpi-1.6.5
But when I make -j8 in the external/caffe,I got a error:
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/multinomial_logistic_loss_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/reshape_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/threshold_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/hdf5_data_layer.cpp
In file included from src/caffe/layers/data_layer.cpp:16:0:
./include/caffe/util/mpi_templates.hpp: In function ‘int MPIAllgather(int, const void*, void*, MPI_Comm) [with Dtype = float; MPI_Comm = ompi_communicator_t*]’:
./include/caffe/util/mpi_templates.hpp:45:28: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
comm);
^
In file included from ./include/caffe/util/mpi_templates.hpp:5:0,
from src/caffe/layers/data_layer.cpp:16:
/usr/local/include/mpi.h:1033:20: note: initializing argument 1 of ‘int MPI_Allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm)’
OMPI_DECLSPEC int MPI_Allgather(void sendbuf, int sendcount, MPI_Datatype sendtype,
^
In file included from src/caffe/layers/data_layer.cpp:16:0:
./include/caffe/util/mpi_templates.hpp: In function ‘int MPIAllgather(int, const void, void*, MPI_Comm) [with Dtype = double; MPI_Comm = ompi_communicator_t*]’:
./include/caffe/util/mpi_templates.hpp:51:28: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
comm);
^
In file included from ./include/caffe/util/mpi_templates.hpp:5:0,
from src/caffe/layers/data_layer.cpp:16:
/usr/local/include/mpi.h:1033:20: note: initializing argument 1 of ‘int MPI_Allgather(void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm)’
OMPI_DECLSPEC int MPI_Allgather(void sendbuf, int sendcount, MPI_Datatype sendtype,
^
In file included from src/caffe/layers/data_layer.cpp:16:0:
./include/caffe/util/mpi_templates.hpp: In function ‘int MPIScatter(int, const void, void*, int, MPI_Comm) [with Dtype = float; MPI_Comm = ompi_communicator_t*]’:
./include/caffe/util/mpi_templates.hpp:61:17: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
root, comm);
^
In file included from ./include/caffe/util/mpi_templates.hpp:5:0,
from src/caffe/layers/data_layer.cpp:16:
/usr/local/include/mpi.h:1375:20: note: initializing argument 1 of ‘int MPI_Scatter(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm)’
OMPI_DECLSPEC int MPI_Scatter(void sendbuf, int sendcount, MPI_Datatype sendtype,
^
In file included from src/caffe/layers/data_layer.cpp:16:0:
./include/caffe/util/mpi_templates.hpp: In function ‘int MPIScatter(int, const void, void*, int, MPI_Comm) [with Dtype = double; MPI_Comm = ompi_communicator_t*]’:
./include/caffe/util/mpi_templates.hpp:67:17: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
root, comm);
^
In file included from ./include/caffe/util/mpi_templates.hpp:5:0,
from src/caffe/layers/data_layer.cpp:16:
/usr/local/include/mpi.h:1375:20: note: initializing argument 1 of ‘int MPI_Scatter(void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm)’
OMPI_DECLSPEC int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
^
make: *** [.build_release/src/caffe/layers/data_layer.o] Error 1
make: *** Waiting for unfinished jobs....
The following is my Makefile.config:
Refer to http://caffe.berkeleyvision.org/installation.html
Contributions simplifying and improving our build system are welcome!
cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
MPI data parallelization switch (uncomment to build with MPI).
USE_MPI := 1
MPI_INCLUDE := /usr/local/include
MPI_LIB := /usr/local/lib
CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
To customize your choice of compiler, uncomment and set the following.
N.B. the default for Linux is g++ and the default for OSX is clang++
CUSTOM_CXX := g++
CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
On Ubuntu 14.04, if cuda tools are installed via
"sudo apt-get install nvidia-cuda-toolkit" then use this instead:
CUDA_DIR := /usr
CUDA architecture setting: going with all of them.
For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20
-gencode arch=compute_20,code=sm_21
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=sm_50
-gencode arch=compute_50,code=compute_50
BLAS choice:
atlas for ATLAS (default)
mkl for MKL
open for OpenBlas
BLAS := atlas
Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
Leave commented to accept the defaults for your choice of BLAS
(which should work)!
BLAS_INCLUDE := /path/to/your/blas
BLAS_LIB := /path/to/your/blas
Homebrew puts openblas in a directory that is not on the standard search path
BLAS_INCLUDE := $(shell brew --prefix openblas)/include
BLAS_LIB := $(shell brew --prefix openblas)/lib
This is required only if you will compile the matlab interface.
MATLAB directory should contain the mex binary in /bin.
MATLAB_DIR := /usr/local/MATLAB/R2014a
MATLAB_DIR := /Applications/MATLAB_R2012b.app
NOTE: this is required only if you will compile the python interface.
We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7
/usr/lib/python2.7/dist-packages/numpy/core/include
Anaconda Python distribution is quite popular. Include path:
Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := $(HOME)/anaconda
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/local/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib
Homebrew installs numpy in a non standard path (keg only)
PYTHON_INCLUDE +=$(dir $ (shell python -c 'import numpy.core; print(numpy.core.file)'))/include
PYTHON_LIB += $(shell brew --prefix numpy)/lib
Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1
Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
INCLUDE_DIRS += $(shell brew --prefix)/include
LIBRARY_DIRS += $(shell brew --prefix)/lib
Uncomment to use
pkg-config
to specify OpenCV library paths.(Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
USE_PKG_CONFIG := 1
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
Uncomment for debugging. Does not work on OSX due to BVLC/caffe#171
DEBUG := 1
The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
enable pretty build (comment to see full commands)
Q ?= @
Could you please tell me how to solve it?
Thank you very much!
The text was updated successfully, but these errors were encountered: