# 版本对齐,博主的环境
显卡驱动:最新版
CUDA:10.1
Python:3.6.5
Pytorch(GPU版):1.4.0
系统:windows10
>>> git submodule update --init --recursive
Submodule 'monodepth/mannequin_challenge' (https://github.com/roxanneluo/mannequinchallenge.git) registered for path 'monodepth/mannequin_challenge'
Submodule 'monodepth/midas_v2' (https://github.com/roxanneluo/MiDaS-1.git) registered for path 'monodepth/midas_v2'
Submodule 'monodepth/monodepth2' (https://github.com/roxanneluo/monodepth2.git) registered for path 'monodepth/monodepth2'
Submodule 'third_party/OpticalFlowToolkit' (https://github.com/roxanneluo/OpticalFlowToolkit.git) registered for path 'third_party/OpticalFlowToolkit'
Submodule 'third_party/colmap' (https://github.com/colmap/colmap.git) registered for path 'third_party/colmap'
Submodule 'flownet2' (https://github.com/roxanneluo/flownet2-pytorch.git) registered for path 'third_party/flownet2'
Cloning into 'PATH/TO/consistent_depth/monodepth/mannequin_challenge'...
Cloning into 'PATH/TO/consistent_depth/monodepth/midas_v2'...
Cloning into 'PATH/TO/consistent_depth/monodepth/monodepth2'...
Cloning into 'PATH/TO/consistent_depth/third_party/OpticalFlowToolkit'...
Cloning into 'PATH/TO/consistent_depth/third_party/colmap'...
Cloning into 'PATH/TO/consistent_depth/third_party/flownet2'...
问题原因:git下载失败
解决办法:根据错误提示,手动下载git源码,分别解压到对应的目录下。如果文件夹不存在,则新建文件夹。
分别下载Submodule
https://github.com/roxanneluo/mannequinchallenge.git
https://github.com/roxanneluo/MiDaS-1.git
https://github.com/roxanneluo/monodepth2.git
https://github.com/roxanneluo/OpticalFlowToolkit.git
https://github.com/colmap/colmap.git
https://github.com/roxanneluo/flownet2-pytorch.git
分别 Cloning into 到对应目录
PATH/TO/consistent_depth/monodepth/mannequin_challenge
PATH/TO/consistent_depth/monodepth/midas_v2
PATH/TO/consistent_depth/monodepth/monodepth2
PATH/TO/consistent_depth/third_party/OpticalFlowToolkit
PATH/TO/consistent_depth/third_party/colmap
PATH/TO/consistent_depth/third_party/flownet2
比如,下载 https://github.com/roxanneluo/mannequinchallenge.git,解压到 consistent_depth/monodepth/mannequin_challenge 目录下
>>> conda create -n consistent_depth python=3.6
>>> conda activate consistent_depth
>>> ./scripts/install.sh
>>> pip install -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html
执行上面的指令,提示安装包出错
解决办法:
方法一(推荐):理解 install.sh 中的指令,执行对应的指令(由于博主手动安装了 requirements.txt 里的包,所以对 install.sh 没有任何操作)
参考博客 【终极篇】shell脚本下载资源失败的解决办法
方法二:修改相对路径,博主试了好几次都失败,果断放弃了
参考博客 windows10安装ffmpeg
参考博客 Windows+COLMAP三维重建教程【exe安装】
>>> python main.py --video_file data/videos/ayush.mp4 --path results/ayush --camera_params "1671.770118, 540, 960" --camera_model "SIMPLE_PINHOLE" --make_video
执行上面的指令,出现的问题
(consistent_depth) PATH\TO\consistent_depth>python main.py --video_file data/videos/ayush.mp4 --path results/ayush --camera_params "1671.77011
8, 540, 960" --camera_model "SIMPLE_PINHOLE" --make_video
Traceback (most recent call last):
File "main.py", line 4, in
from params import Video3dParamsParser
File "PATH\TO\consistent_depth\params.py", line 6, in
from monodepth.depth_model_registry import get_depth_model, get_depth_model_list
File "PATH\TO\consistent_depth\monodepth\depth_model_registry.py", line 5, in
from .mannequin_challenge_model import MannequinChallengeModel
File "PATH\TO\consistent_depth\monodepth\mannequin_challenge_model.py", line 10, in
from .mannequin_challenge.models import pix2pix_model
File "PATH\TO\consistent_depth\monodepth\mannequin_challenge\models\pix2pix_model.py", line 21, in
from models import base_model
ModuleNotFoundError: No module named 'models'
#PATH\TO\consistent_depth\monodepth\mannequin_challenge\models\pix2pix_model.py
from models import base_model
from models import networks
from models import hourglass
解决办法:修改为相对导入
#PATH\TO\consistent_depth\monodepth\mannequin_challenge\models\pix2pix_model.py
from ..models import base_model
from ..models import networks
from ..models import hourglass
import resample2d_cuda
ModuleNotFoundError: No module named 'resample2d_cuda'
问题原因:下载的第三方包没有编译,找不到包
解决办法:编译第三方包,并安装这些编译好的包
>>> cd PATH\TO\consistent_depth\third_party\flownet2\networks\resample2d_package/
>>> python setup.py build # 编译第三方包
>>> python setup.py install # 安装包
>>> python setup.py build
执行上面的指令,出现的问题
32 errors detected in the compilation of "resample2d_kernel.cu".
error: command 'PATH\\TO\\CUDA11.2\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\bin\\nvcc.exe' failed with exit status 1
问题原因
博主最开始的CUDA版本是11.2
Pytorch1.4.0匹配的CUDA版本是10.1
版本不匹配,导致cuda编译失败
方法一(推荐):CUDA多版本管理,安装对应的CUDA版本
参考博客 https://blog.csdn.net/qq_27825451/article/details/89135592
方法二(不推荐):
降低CUDA版本,卸载之后安装CUDA11.1
参考博客 windows下CUDA的卸载以及安装
问题原因:虚拟内存不足,使得编译失败
解决办法:
参考博客 OSError: [WinError 1455] 页面文件太小,无法完成操作
问题原因:python3.6.0版本与pytorch1.4.0不匹配
解决办法:升级Python==3.6.5
参考博客 windows安装Pytorch报错:from torch._C import * ImportError: DLL load failed: 找不到指定的模块”解决方案
解决办法:
参考博客 Cuda Compile Error Windows 10
将文件 resample2d_kernel.cu 中的 floor 替换成 floorf
ERROR: %d frames extracted, but %d PTS entries.
ERROR: 92 frames extracted, but 0 PTS entries.
问题原因:
>>> ffprobe data/videos/ayush.mp4 -select_streams v:0 -show_frames | grep pkt_pts_time
# 在windows中执行错误,grep不是内部或外部命令,也不是可运行的程序
解决办法:修改判断条件,跳过判断条件
# self.frame_count = count
if count != self.frame_count:
sys.exit(
"ERROR: %d frames extracted, but %d PTS entries."% (count, self.frame_count))