Closed qvandenberg closed 5 years ago
Hi Q This is an error because arising because you copied highdimfilter in a python environment different from the one used for running the code. Why do you use python3 instead of python2.7 ? In either cas, you should do make under the virtualenv used to make run demo.py.
Hi Matthias
I just changed my virtualenv to python2.7 and it produced the same error. I printed out the versions of all the other packages, that might hold some clues. requirements_q.txt
Hi Q You have to "make clean" in the cpp folder et redo "make" under the same virtualenv you use for running python otherwise, tf won't load the new op. Did you do this ?
Indeed, I was in the virtualenv while I used "make clean" to remove the .so file and compiled a new one. Unfortunately tf isn't able to locate the new op...
Hi Q What is your platform ? Desktop or server ? Perhaps the same problem is pointed there : https://github.com/sadeepj/crfasrnn_keras/issues/35
Hi Matthias, It occurs on two different machines (desktop & laptop). They're both OSX, one High Sierra and the other Mojave. I haven't tried on a server yet.
I just looked at issue #35 as suggested. There is a line that can cause trouble as tensorflow went beyond version 1.10. This expression in the makefile would no longer work, so I removed the related conditional statement.
# Is the Tensorflow version >= 1.4?
TF_VERSION_GTE_1_4 := $(shell expr `python -c 'import tensorflow as tf; print(tf.__version__)' | cut -f1,2 -d.` \>= 1.4)
That was unfortunately not enough to fix it.
Hi Q, Did you fix your problem ? Trying this within the src/cpp/ folder ?
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )
g++ -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -shared -fPIC -I~/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/tensorflow/include -O2 -o high_dim_filter.so high_dim_filter.cc modified_permutohedral.cc
Unfortunately I've not been able to, also not with previous versions of tensorflow.
Running your command produces the error:
high_dim_filter.cc:25:42: fatal error: tensorflow/core/framework/op.h: No such file or directory
#include "tensorflow/core/framework/op.h"
This is on a Mac, not a Linux.
What about with TF version 1.2 ?
@qvandenberg Have you fixed that problem? I meet the same problem too. I tried several versions mentioned here, but none works.
It's fixed now, thank you for your efforts. The problem turned out to be the C++ compiler. It worked only when I used C++ 4.2.1: Apple LLVM version 7.0.0 (clang-700.1.76)
It's stored under /usr/bin instead of /usr/local/bin where I keep most of my binaries. That caused the import problem.
@qvandenberg Got it! Thanks a lot!
Hello! When I run the sh.compile.sh command, it compiles successfully, but when I run train.py, I get an error: undefined symbol:_ZTIN10tensorflow8opkernelE. I checked a lot of information on the Internet and did not solve it. Hope you help me see what is the problem. Thanks again! ! ! ubuntu :16.04 ; nvidia-driver-440;cuda:10.0; cudnn:7.5.0; tensorflow-gpu:1.13.1; gcc/g++:5.4.0;
@matthiasmace
Despite following instructions on similar issues, this error persists. Has anyone been able to resolve it so far?