Skip to content
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 in 'make' #3

Open
czy36mengfei opened this issue Oct 10, 2018 · 4 comments
Open

error in 'make' #3

czy36mengfei opened this issue Oct 10, 2018 · 4 comments

Comments

@czy36mengfei
Copy link

When I run 'make' in build directory , there some errors:

[100%] Linking CXX shared library libextra_losses.so
/usr/bin/ld: 找不到 -ltensorflow_framework
collect2: error: ld returned 1 exit status
CMakeFiles/extra_losses.dir/build.make:166: recipe for target 'libextra_losses.so' failed
make[2]: *** [libextra_losses.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/extra_losses.dir/all' failed
make[1]: *** [CMakeFiles/extra_losses.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

do you know the reason? thank you for your help.

ubuntu16.04+python3.6(anaconda3)+tensorflow1.6
thank you very much.

@HiKapok
Copy link
Owner

HiKapok commented Oct 10, 2018

@czy36mengfei cmake的输出看一下

@czy36mengfei
Copy link
Author

学长好,
cmake输出如下
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda-9.0 (found version "9.0")
-- Found CWD: /home/cciip/install_package/tf.extra_losses-master/build
-- Found GPU_CAPABILITY: gencode arch=compute_61,code=sm_61

Traceback (most recent call last):
File "", line 1, in
ImportError: No module named 'tensorflow'
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named 'tensorflow'
-- Found TF_INC:
-- Found TF_INC_EXTERNAL: /external/nsync/public
-- Found TF_LIB:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cciip/install_package/tf.extra_losses-master/build

是因为我的tensorflow是anoconda的python安装的,所以导入tensorflow失败吗?有什么解决的方案吗?

thanks from Huster

@HiKapok
Copy link
Owner

HiKapok commented Oct 11, 2018

@czy36mengfei 看一下python命令默认是哪个环境?tensorflow,TF_LIB都没找到

@czy36mengfei
Copy link
Author

@czy36mengfei 看一下python命令默认是哪个环境?tensorflow,TF_LIB都没找到

十分感谢您的解答。我发现CMakeLists里调用的是python3.5而不是默认的python,我把它改成python就可以了。

不过在跑test_op.py测试的时候出现了新的问题:
*** Begin stack trace ***
tensorflow::CurrentStackTrace()

std::_Function_handler<void (long long, long long), LargeMarginSoftmaxFunctor<Eigen::ThreadPoolDevice, float>::operator()(tensorflow::OpKernelContext*, Eigen::ThreadPoolDevice const&, Eigen::TensorMap<Eigen::Tensor<float const, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float const, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<int const, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<int const, 1, 1, long>, 16, Eigen::MakePointer>, int, int, int, float, float, float, float, int, bool, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>)::{lambda(long, long)#1}>::_M_invoke(std::_Any_data const&, long long&&, std::_Any_data const&)
tensorflow::thread::ThreadPool::Impl::ParallelFor(long long, long long, std::function<void (long long, long long)>)
tensorflow::thread::ThreadPool::ParallelFor(long long, long long, std::function<void (long long, long long)>)
tensorflow::Shard(int, tensorflow::thread::ThreadPool*, long long, long long, std::function<void (long long, long long)>)
LargeMarginSoftmaxFunctor<Eigen::ThreadPoolDevice, float>::operator()(tensorflow::OpKernelContext*, Eigen::ThreadPoolDevice const&, Eigen::TensorMap<Eigen::Tensor<float const, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float const, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<int const, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<int const, 1, 1, long>, 16, Eigen::MakePointer>, int, int, int, float, float, float, float, int, bool, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>)
LargeMarginSoftmaxOp<Eigen::ThreadPoolDevice, float>::Compute(tensorflow::OpKernelContext*)
tensorflow::ThreadPoolDevice::Compute(tensorflow::OpKernel*, tensorflow::OpKernelContext*)


Eigen::NonBlockingThreadPoolTempl<tensorflow::thread::EigenEnvironment>::WorkerLoop(int)
std::_Function_handler<void (), tensorflow::thread::EigenEnvironment::CreateThread(std::function<void ()>)::{lambda()#1}>::_M_invoke(std::_Any_data const&)


clone

*** End stack trace ***
已放弃 (核心已转储)

里面没有具体的错误信息,所以不知道是什么问题,望解答。

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

No branches or pull requests

2 participants