YvanYin / VNL_Monocular_Depth_Prediction

Monocular Depth Prediction
Other
462 stars 79 forks source link

yaml_cfg load error #69

Open fisakhan opened 3 years ago

fisakhan commented 3 years ago

I get the following error:

Traceback (most recent call last): File "test_nyu_metric.py", line 22, in merge_cfg_from_file(test_args) File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/core/config.py", line 133, in merge_cfg_from_file yaml_cfg = AttrDict(yaml.load(f)) TypeError: load() missing 1 required positional argument: 'Loader'

Following this, I replaced load with safe_load and then got the following error:

Traceback (most recent call last): File "test_nyu_metric.py", line 22, in merge_cfg_from_file(test_args) File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/core/config.py", line 133, in merge_cfg_from_file yaml_cfg = AttrDict(yaml.safe_load(f)) File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/utils/collections.py", line 8, in init super(AttrDict, self).init(*args, **kwargs) TypeError: 'NoneType' object is not iterable

fisakhan commented 3 years ago

When I solve the above problem then I get the following problem:

----------------- Options --------------- batchsize: 2
cfg_file: lib/configs/resnext101_32x4d_nyudv2_class [default: lib/configs/resnext_32x4d_nyudv2_c1] dataroot: ./datasets/NYUDV2 [default: None] dataset: nyudv2
epoch: 30
load_ckpt: ./nyu_rawdata.pth [default: None] phase: test
phase_anno: test
results_dir: ./evaluation
resume: False
start_epoch: 0
start_step: 0
thread: 4
use_tfboard: False
----------------- End ------------------- INFO nyudv2_dataset.py: 38: Loaded NYUDV2 data! INFO load_dataset.py: 31: nyudv2 is created. INFO test_nyu_metric.py: 26: test_data_size: 654
loading model... cfg.MODEL.ENCODER: resnext101_32x4d_body_stride16 bottom_up_model: lateral_net.lateral_resnext101_32x4d_body_stride16 Traceback (most recent call last): File "test_nyu_metric.py", line 30, in model = MetricDepthModel() File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/models/metric_depth_model.py", line 16, in init self.depth_model = DepthModel() File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/models/metric_depth_model.py", line 123, in init self.decoder_modules = lateral_net.fcn_topdown(cfg.MODEL.ENCODER) File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 190, in init self._init_modules(self.init_type) File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 193, in _init_modules self._init_weights(init_type) File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 211, in _init_weights child_m.apply(init_func) File "/home/.virtualenvs/consistent_depth/lib/python3.6/site-packages/torch/nn/modules/module.py", line 445, in apply module.apply(fn) File "/home/.virtualenvs/consistent_depth/lib/python3.6/site-packages/torch/nn/modules/module.py", line 446, in apply fn(self) File "/home/Projects/consistent_depth/VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 207, in initfunc nn.init.normal(m.weight.data, 1.0, 0.0) File "/home/.virtualenvs/consistentdepth/lib/python3.6/site-packages/torch/nn/init.py", line 140, in normal return _no_gradnormal(tensor, mean, std) File "/home/.virtualenvs/consistent_depth/lib/python3.6/site-packages/torch/nn/init.py", line 19, in _no_gradnormal return tensor.normal(mean, std) RuntimeError: normal expects std > 0.0, but found std=0

I guess, it has something to do with __C.MODEL.INIT_TYPE = 'xavier'