Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

comiple error about the ndarray or something else #1528

Closed
dangweili opened this issue Feb 25, 2016 · 7 comments
Closed

comiple error about the ndarray or something else #1528

dangweili opened this issue Feb 25, 2016 · 7 comments

Comments

@dangweili
Copy link

There is a problem when compile the mxnet on centos6.5 without cudadnn and the cuda version is 6.5.
The error is about the ndarray or something else, I am not sure about it. Could anyone else help me fix this problem ? Thank you very much.

build/src/ndarray/ndarray.o: In function std::_Function_handler<void ()(mxnet::RunContext, mxnet::engine::CallbackOnComplete), void mxnet::Engine::PushSync<mxnet::ClipOp(mxn et::NDArray const&, float const&, float const&, mxnet::NDArray*)::{lambda(mxnet::RunContext)#2}>(mxnet::ClipOp(mxnet::NDArray const&, float const&, float const&, mxnet::NDArr ay*)::{lambda(mxnet::RunContext)#2}, mxnet::Context, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var> > const&, std::vector<mxnet::engine::Var*, std::alloc ator<mxnet::engine::Var> > const, mxnet::FnProperty, int)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::RunConte xt, mxnet::engine::CallbackOnComplete)': ndarray.cc:(.text+0x7aa): undefined reference tovoid mxnet::ndarray::EvalClipmshadow::gpu(mshadow::TBlob const&, float const&, float const&, mshadow::TBlob_, mxnet::RunCo
ntext)'
build/src/ndarray/ndarray.o: In function std::_Function_handler<void ()(mxnet::RunContext, mxnet::engine::CallbackOnComplete), void mxnet::Engine::PushSync<mxnet::SetValueOp (float const&, mxnet::NDArray_)::{lambda(mxnet::RunContext)#2}>(mxnet::SetValueOp(float const&, mxnet::NDArray_)::{lambda(mxnet::RunContext)#2}, mxnet::Context, std::vector<m xnet::engine::Var_, std::allocatormxnet::engine::Var > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var> > const, mxnet::FnProperty, int)::{lambda (mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::RunContext, mxnet::engine::CallbackOnComplete)': ndarray.cc:(.text+0x8b1): undefined reference to void mxnet::ndarray::Evalmshadow::gpu(float const&, mshadow::TBlob*, mxnet::RunContext)'
build/src/ndarray/ndarray.o: In functionstd::_Function_handler<void ()(mxnet::RunContext, mxnet::engine::CallbackOnComplete), void mxnet::Engine::PushSync<mxnet::CopyFromTo (mxnet::NDArray const&, mxnet::NDArray*, int)::{lambda(mxnet::RunContext)#2}>(mxnet::CopyFromTo(mxnet::NDArray const&, mxnet::NDArray_, int)::{lambda(mxnet::RunContext)#2}, m xnet::Context, std::vector<mxnet::engine::Var_, std::allocatormxnet::engine::Var > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var> > const, mxne t::FnProperty, int)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::RunContext, mxnet::engine::CallbackOnComplete) ': ndarray.cc:(.text+0x9e5): undefined reference to void mxnet::ndarray::Copy<mshadow::cpu, mshadow::gpu>(mshadow::TBlob const&, mshadow::TBlob*, mxnet::Context, mxnet::Context
, mxnet::RunContext)'
build/src/ndarray/ndarray.o: In functionstd::_Function_handler<void ()(mxnet::RunContext, mxnet::engine::CallbackOnComplete), void mxnet::Engine::PushSync<mxnet::CopyFromTo (mxnet::NDArray const&, mxnet::NDArray*, int)::{lambda(mxnet::RunContext)#3}>(mxnet::CopyFromTo(mxnet::NDArray const&, mxnet::NDArray_, int)::{lambda(mxnet::RunContext)#3}, m xnet::Context, std::vector<mxnet::engine::Var_, std::allocatormxnet::engine::Var > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var> > const, mxne t::FnProperty, int)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::RunContext, mxnet::engine::CallbackOnComplete) ': ndarray.cc:(.text+0xb55): undefined reference to void mxnet::ndarray::Copy<mshadow::gpu, mshadow::cpu>(mshadow::TBlob const&, mshadow::TBlob*, mxnet::Context, mxnet::Context
, mxnet::RunContext)'
build/src/ndarray/ndarray.o: In functionstd::_Function_handler<void ()(mxnet::RunContext, mxnet::engine::CallbackOnComplete), void mxnet::Engine::PushSync<mxnet::CopyFromTo (mxnet::NDArray const&, mxnet::NDArray*, int)::{lambda(mxnet::RunContext)#4}>(mxnet::CopyFromTo(mxnet::NDArray const&, mxnet::NDArray_, int)::{lambda(mxnet::RunContext)#4}, m xnet::Context, std::vector<mxnet::engine::Var_, std::allocatormxnet::engine::Var > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var> > const, mxne t::FnProperty, int)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::RunContext, mxnet::engine::CallbackOnComplete) ': ndarray.cc:(.text+0xcc5): undefined reference to void mxnet::ndarray::Copy<mshadow::gpu, mshadow::gpu>(mshadow::TBlob const&, mshadow::TBlob*, mxnet::Context, mxnet::Context
, mxnet::RunContext)'

................................................................
................................................................
build/src/operator/softmax_activation.o: In function mxnet::op::SoftmaxActivationProp::CreateOperator(mxnet::Context) const': softmax_activation.cc:(.text+0x3bc): undefined reference tomxnet::Operator* mxnet::op::CreateOpmshadow::gpu(mxnet::op::SoftmaxActivationParam)'
build/src/operator/softmax_output.o: In function mxnet::op::SoftmaxOutputProp::CreateOperator(mxnet::Context) const': softmax_output.cc:(.text+0x7a1): undefined reference tomxnet::Operator* mxnet::op::CreateOpmshadow::gpu(mxnet::op::SoftmaxOutputParam)'
build/src/operator/swapaxis.o: In function mxnet::op::SwapAxisProp::CreateOperator(mxnet::Context) const': swapaxis.cc:(.text+0x38d): undefined reference tomxnet::Operator* mxnet::op::CreateOpmshadow::gpu(mxnet::op::SwapAxisParam)'
build/src/operator/upsampling.o: In function mxnet::op::UpSamplingProp::CreateOperator(mxnet::Context) const': upsampling.cc:(.text+0x38a5): undefined reference tomxnet::Operator* mxnet::op::CreateOpmshadow::gpu(mxnet::op::UpSamplingParam)'
build/src/optimizer/sgd.o: In function std::_Function_handler<void ()(mxnet::RunContext, mxnet::engine::CallbackOnComplete), void mxnet::Engine::PushSync<mxnet::opt::SGDOpt: :Update(int, mxnet::NDArray*, mxnet::NDArray const*, float, float)::{lambda(mxnet::RunContext)#4}>(mxnet::opt::SGDOpt::Update(int, mxnet::NDArray*, mxnet::NDArray const*, flo at, float)::{lambda(mxnet::RunContext)#4}, mxnet::Context, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var> > const&, std::vector<mxnet::engine::Var*, std: :allocator<mxnet::engine::Var> > const, mxnet::FnProperty, int)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::Ru nContext, mxnet::engine::CallbackOnComplete)': sgd.cc:(.text._ZNSt17_Function_handlerIFvN5mxnet10RunContextENS0_6engine18CallbackOnCompleteEEZNS0_6Engine8PushSyncIZNS0_3opt6SGDOpt6UpdateEiPNS0_7NDArrayEPKS9_ffEUlS1_E2_EEv T_NS0_7ContextERKSt6vectorIPNS2_3VarESaISI_EESM_NS0_10FnPropertyEiEUlS1_S3_E_E9_M_invokeERKSt9_Any_dataS1_S3_[_ZNSt17_Function_handlerIFvN5mxnet10RunContextENS0_6engine18Call backOnCompleteEEZNS0_6Engine8PushSyncIZNS0_3opt6SGDOpt6UpdateEiPNS0_7NDArrayEPKS9_ffEUlS1_E2_EEvT_NS0_7ContextERKSt6vectorIPNS2_3VarESaISI_EESM_NS0_10FnPropertyEiEUlS1_S3_E_E 9_M_invokeERKSt9_Any_dataS1_S3_]+0x9c): undefined reference tomxnet::opt::call_sgd_update_gpu(mxnet::RunContext, mshadow::TBlob, mshadow::TBlob, float, float, mxnet::opt::S
GDParam const&)'
build/src/optimizer/sgd.o: In function std::_Function_handler<void ()(mxnet::RunContext, mxnet::engine::CallbackOnComplete), void mxnet::Engine::PushSync<mxnet::opt::SGDOpt$ :Update(int, mxnet::NDArray*, mxnet::NDArray const*, float, float)::{lambda(mxnet::RunContext)#3}>(mxnet::opt::SGDOpt::Update(int, mxnet::NDArray*, mxnet::NDArray const*, fl$ at, float)::{lambda(mxnet::RunContext)#3}, mxnet::Context, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var> > const&, std::vector<mxnet::engine::Var*, std$ :allocator<mxnet::engine::Var> > const, mxnet::FnProperty, int)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::R$ nContext, mxnet::engine::CallbackOnComplete)': sgd.cc:(.text._ZNSt17_Function_handlerIFvN5mxnet10RunContextENS0_6engine18CallbackOnCompleteEEZNS0_6Engine8PushSyncIZNS0_3opt6SGDOpt6UpdateEiPNS0_7NDArrayEPKS9_ffEUlS1_E1_EE$T_NS0_7ContextERKSt6vectorIPNS2_3VarESaISI_EESM_NS0_10FnPropertyEiEUlS1_S3_E_E9_M_invokeERKSt9_Any_dataS1_S3_[_ZNSt17_Function_handlerIFvN5mxnet10RunContextENS0_6engine18Cal$ backOnCompleteEEZNS0_6Engine8PushSyncIZNS0_3opt6SGDOpt6UpdateEiPNS0_7NDArrayEPKS9_ffEUlS1_E1_EEvT_NS0_7ContextERKSt6vectorIPNS2_3VarESaISI_EESM_NS0_10FnPropertyEiEUlS1_S3_E_$ 9_M_invokeERKSt9_Any_dataS1_S3_]+0xbd): undefined reference tomxnet::opt::call_sgd_mom_update_gpu(mxnet::RunContext, mshadow::TBlob, mshadow::TBlob, mshadow::TBlob, float, float, mxnet::opt::SGDParam const&)'
collect2: error: ld returned 1 exit status
make: *** [bin/im2rec] Error 1

@dangweili
Copy link
Author

I think I should add message below to give a better description about the error state.

g++ -DMSHADOW_FORCE_STREAM -Wall -O3 -I./mshadow/ -I./dmlc-core/include -fPIC -Iinclude -msse3 -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -I/data1/NLPRMNT/lidangwei/local/cuda-6.5/include -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMXNET_USE_OPENCV=1 pkg-config --cflags opencv -fopenmp -DMXNET_USE_NVRTC=0 -std=c++0x -o bin/im2rec tools/im2rec.cc build/src/resource.o build/src/c_api/c_api.o build/src/c_api/c_api_error.o build/src/c_api/c_predict_api.o build/src/common/mxrtc.o build/src/common/tblob_op_registry.o build/src/engine/engine.o build/src/engine/naive_engine.o build/src/engine/threaded_engine.o build/src/engine/threaded_engine_perdevice.o build/src/engine/threaded_engine_pooled.o build/src/io/io.o build/src/io/iter_csv.o build/src/io/iter_image_recordio.o build/src/io/iter_mnist.o build/src/kvstore/kvstore.o build/src/ndarray/ndarray.o build/src/ndarray/ndarray_function.o build/src/ndarray/unary_function.o build/src/operator/activation.o build/src/operator/batch_norm.o build/src/operator/block_grad.o build/src/operator/cast.o build/src/operator/concat.o build/src/operator/convolution.o build/src/operator/crop.o build/src/operator/cross_device_copy.o build/src/operator/cudnn_batch_norm.o build/src/operator/deconvolution.o build/src/operator/dropout.o build/src/operator/elementwise_binary_op.o build/src/operator/elementwise_binary_scalar_op.o build/src/operator/elementwise_sum.o build/src/operator/embedding.o build/src/operator/fully_connected.o build/src/operator/identity_attach_KL_sparse_reg.o build/src/operator/leaky_relu.o build/src/operator/lrn.o build/src/operator/native_op.o build/src/operator/ndarray_op.o build/src/operator/operator.o build/src/operator/pooling.o build/src/operator/regression_output.o build/src/operator/reshape.o build/src/operator/slice_channel.o build/src/operator/softmax_activation.o build/src/operator/softmax_output.o build/src/operator/swapaxis.o build/src/operator/upsampling.o build/src/optimizer/optimizer.o build/src/optimizer/sgd.o build/src/storage/storage.o build/src/symbol/graph_executor.o build/src/symbol/graph_memory_allocator.o build/src/symbol/static_graph.o build/src/symbol/symbol.o dmlc-core/libdmlc.a -pthread -lm -lcudart -lcublas -lcurand -L/data1/NLPRMNT/lidangwei/local/cuda-6.5/lib64 -L/data1/NLPRMNT/lidangwei/local/cuda-6.5/lib -lrt pkg-config --libs opencv

@dangweili
Copy link
Author

@mli @piiswrong could you give me some suggestions?

@piiswrong
Copy link
Contributor

it's hard to tell what happened.
Try removing the repo and do a fresh clone, then git submodule update && make clean && make

@dangweili
Copy link
Author

I reinstall the repo and change the atlas to mkl, then it works.
The mxnet cannot find the atlas library, although it is in the system path (/usr/lib64/atlas).
So how to add the other include and library path in the config.mk ?

@dangweili
Copy link
Author

After the compile is ok, there still exist a problem in running.
I test the example of python example/image-classification/train_mnist.py
It returns a Segmentation fault.
So I try another example Inception_BN classification, It stills return a segmentation error.
I donot know why.

python example/image-classification/train_mnist.py

/data1/NLPRMNT/lidangwei/MxNet/mxnet/example/image-classification/train_mnist.py(131)()
-> train_model.fit(args, net, get_iterator(data_shape))
(Pdb) c
2016-02-25 18:49:29,276 Node[0] start with arguments Namespace(batch_size=128, data_dir='mnist/', gpus=None, kv_store='local', load_epoch=None, lr=0.1, lr_factor=1, lr_factor_epoch=1, model_prefix=None, network='mlp', num_epochs=10, num_examples=60000)
[Segmentation fault

@dangweili
Copy link
Author

Here I list the example code given in example/notebook/...
The code will be segmentation fault at model = mx.model.Feed.....
The compile is ok. So why?

#!/usr/bin/env python
import mxnet as mx
import logging
import numpy as np
from skimage import io, transform
import pdb
pdb.set_trace()
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)

Load the pre-trained model

prefix = "Inception/Inception_BN"
num_round = 39
model = mx.model.FeedForward.load(prefix, num_round, ctx=mx.gpu(), numpy_batch_size=1)

@dangweili
Copy link
Author

I have worked out the problem, this issue could be closed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants