远程服务器运行Non-Rigid NeRF时COLMAP执行报错求助
远程服务器运行COLMAP生成位姿时Qt平台插件报错解决
我正在研究LLFF和Non-Rigid NeRF的代码,已按指引完成依赖安装。在远程服务器上执行命令python preprocess.py --input data/example_sequence1/,通过COLMAP的SfM从图像生成位姿时出现报错,具体报错信息如下:
Need to run COLMAP qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb. *** Aborted at 1660905461 (unix time) try "date -d @1660905461" if you are using GNU date *** PC: @ 0x0 (unknown) *** SIGABRT (@0x3e900138a9f) received by PID 1280671 (TID 0x7f5740d49000) from PID 1280671; stack trace: *** @ 0x7f57463a2197 google::(anonymous namespace)::FailureSignalHandler() @ 0x7f574421f420 (unknown) @ 0x7f5743bf300b gsignal @ 0x7f5743bd2859 abort @ 0x7f57442be35b QMessageLogger::fatal() @ 0x7f574477c799 QGuiApplicationPrivate::createPlatformIntegration() @ 0x7f574477cb6f QGuiApplicationPrivate::createEventDispatcher() @ 0x7f57443dbb62 QCoreApplicationPrivate::init() @ 0x7f574477d1e1 QGuiApplicationPrivate::init() @ 0x7f5744c03bc5 QApplicationPrivate::init() @ 0x562bbb634975 colmap::RunFeatureExtractor() @ 0x562bbb61d1a0 main @ 0x7f5743bd4083 __libc_start_main @ 0x562bbb620e39 (unknown) Traceback (most recent call last): File "imgs2poses.py", line 18, in <module> gen_poses(args.scenedir, args.match_type) File "/data1/user_data/ashish/NeRF/LLFF/llff/poses/pose_utils.py", line 268, in gen_poses run_colmap(basedir, match_type) File "/data1/user_data/ashish/NeRF/LLFF/llff/poses/colmap_wrapper.py", line 35, in run_colmap feat_output = ( subprocess.check_output(feature_extractor_args, universal_newlines=True) ) File "/home/ashish/anaconda3/envs/nrnerf/lib/python3.6/subprocess.py", line 356, in check_output **kwargs).stdout File "/home/ashish/anaconda3/envs/nrnerf/lib/python3.6/subprocess.py", line 438, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['colmap', 'feature_extractor', '--database_path', 'scenedir/database.db', '--image_path', 'scenedir/images', '--ImageReader.single_camera', '1']' died with <Signals.SIGABRT: 6>.
解决方法
- 核心原因:远程服务器无图形界面,COLMAP默认尝试加载Qt的xcb图形插件,导致初始化失败,需强制使用无渲染模式。
- 临时生效方案:执行命令前先设置环境变量,指定Qt使用offscreen插件:
export QT_QPA_PLATFORM=offscreen python preprocess.py --input data/example_sequence1/ - 永久生效方案:将上述环境变量添加到shell配置文件(如
~/.bashrc)或conda环境的激活脚本中。例如在conda环境的activate.d目录创建env_vars.sh文件,写入:export QT_QPA_PLATFORM=offscreen - 可选优化:如果是源码编译COLMAP,编译时添加
-DBUILD_GUI=OFF参数,直接构建无GUI的headless版本,从根源避免图形插件依赖问题。
内容的提问来源于stack exchange,提问作者Kickstart
相关产品推荐
相关产品推荐

