FOTS代码的错误

2020-07-02  本文已影响0人  每天必吃香菜

一、跑FOTS代码时会遇到如下错误:

make: Entering directory '/home/XXX/FOTS_TF/lanms'

g++ -o adaptor.so -I include  -std=c++11 -O3 -I/home/XXX/anaconda3/envs/tf/include/python3.6m -I/home/XXXanaconda3/envs/tf/include/python3.6m  -Wno-unused-result -Wsign-compare -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -ffunction-sections -pipe -isystem /home/XXX/anaconda3/envs/tf/include -fdebug-prefix-map=/tmp/build/80754af9/python_1588903631989/work=/usr/local/src/conda/python-3.6.10 -fdebug-prefix-map=/home/XXX/anaconda3/envs/tf=/usr/local/src/conda-prefix -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -flto -DNDEBUG -fwrapv -O3 -Wall -L/home/XXX/anaconda3/envs/tf/lib/python3.6/config-3.6m-x86_64-linux-gnu -L/home/XXX/anaconda3/envs/tf/lib -lpython3.6m -lpthread -ldl  -lutil -lrt -lm  -Xlinker -export-dynamic adaptor.cpp include/clipper/clipper.cpp --shared -fPIC

g++: error: unrecognized command line option ‘-fno-plt’

Makefile:10: recipe for target 'adaptor.so' failed

make: *** [adaptor.so] Error 1

make: Leaving directory '/home/XXX/FOTS_TF/lanms'

Traceback (most recent call last):

  File "main_test.py", line 11, in <module>

    import lanms

  File "/home/XXX/FOTS_TF/lanms/__init__.py", line 8, in <module>

    raise RuntimeError('Cannot compile lanms: {}'.format(BASE_DIR))

RuntimeError: Cannot compile lanms: /home/XXX/FOTS_TF/lanms

原因是lanms文件夹下面Makefile文件的问题:

CXXFLAGS = -I include  -std=c++11 -O3 $(shell python3-config --cflags)

LDFLAGS = $(shell python3-config --ldflags)

/home/admin1/anaconda3/include/python3.7m

DEPS = $(shell find include -xtype f)

CXX_SOURCES = pse.cpp

LIB_SO = pse.so

$(LIB_SO): $(CXX_SOURCES) $(DEPS)

    $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(CXX_SOURCES) --shared -fPIC

clean:

    rm -rf $(LIB_SO)

只需粗体的部分为:

CXXFLAGS = -I include  -std=c++11 -O3 -I/home/XXX/anaconda3/include/python3.6m

LDFLAGS = $(shell python3-config --ldflags)

DEPS = $(shell find include -xtype f)

CXX_SOURCES = pse.cpp

LIB_SO = pse.so

$(LIB_SO): $(CXX_SOURCES) $(DEPS)

    $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(CXX_SOURCES) --shared -fPIC

clean:

    rm -rf $(LIB_SO)

二、测试时的错误

调用IC15测试集,运行一段时间报错如下:

ValueError: Cannot feed value of shape (0,) for Tensor 'input_transform_matrix:0', which has shape '(?, 6)'

上一篇 下一篇

猜你喜欢

热点阅读