Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaml_cfg load error #69

Open
fisakhan opened this issue Oct 28, 2021 · 1 comment
Open

yaml_cfg load error #69

fisakhan opened this issue Oct 28, 2021 · 1 comment

Comments

@fisakhan
Copy link

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
Copy link
Author

fisakhan commented Oct 28, 2021

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 init_func
nn.init.normal
(m.weight.data, 1.0, 0.0)
File "/home/.virtualenvs/consistent_depth/lib/python3.6/site-packages/torch/nn/init.py", line 140, in normal

return no_grad_normal(tensor, mean, std)
File "/home/.virtualenvs/consistent_depth/lib/python3.6/site-packages/torch/nn/init.py", line 19, in no_grad_normal
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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant