复现 Unsupervised monocular depth and ego-motion learning with structure and semantics 时遇到i的问题

  Unsupervised monocular depth and ego-motion learning with structure and semantics这篇文章是Google Brain团队在2019年CVPR发布的一篇论文,和同年同团队的另一篇AAAI的Depth Prediction without the Sensors: Leveraging Structure for Unsupervised Learning from Monocular Videos的内容几乎一样,但是他们声称CVPR的这一篇工作有所改进。Whatever,他们的成果展示还是很不错,所以决定复现一下。

成果展示

struct2depth (google.com)

代码地址

models/research/struct2depth at archive · tensorflow/models (github.com)

论文地址

https://arxiv.org/abs/1906.05717

代码距今已经四年了,使用的是tensorflow1.X版本,python版本不详,不过应该是3.X早期版本,因为该团队的工作承接了之前2018年的CVPR  Unsupervised Learning of Depth and Ego-Motion from Monocular Video Using 3D Geometric Constraints

成果展示

vid2depth: Depth from Motion (google.com)

代码地址

models/research/vid2depth at master · tensorflow/models (github.com)

论文地址

https://arxiv.org/pdf/1802.05522.pdf

而这一工作的代码中出现了itertools.izip()这样的用法,这一用法在目前的python3里被自带的zip()函数取代了。我目前使用的版本是tensorflow=1.15, python=3.7,操作系统windows11。

 

  之前一篇文章写过对该项目的inference的复现,其中只遇到了一个问题:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte - parallelarc - 博客园 (cnblogs.com)

但是在实现train的时候,问题一个接一个,十分麻烦。

  首先,根据readme的指导,如果train.py需要执行:

python train.py
--logtostderr
--checkpoint_dir $ckpt_dir
--data_dir $data_dir
--architecture resnet
--imagenet_ckpt $imagenet_ckpt
--imagenet_norm true
--joint_encoder false

由于我是win系统,就不用shell了,直接把变量写成字符串的。直接这样执行,会报错ValueError

......
raise ValueError('Using a joint encoder is currently not supported when '
ValueError: Using a joint encoder is currently not supported when modeling object motion.

根据github上的issue的反馈,需要执行以下三点:

1. 从别处下载resnet预训练模型

2. 本项目的准备数据部分不完整(不能生成train.txt文件),所以需要使用先前的vid2depth项目中生成数据的部分

3. 删除执行的命令中“--joint_encoder false”部分

与之相关的issue地址

models/research/struct2depth: pretrained model · Issue #6297 · tensorflow/models (github.com)

struct2depth Convolution not supported for input with rank · Issue #6298 · tensorflow/models (github.com)

操作下来发现确实可行,但是还有新的问题。。。

posted @ 2022-07-09 17:02  parallelarc  阅读(116)  评论(0)    收藏  举报