YvanYin / VNL_Monocular_Depth_Prediction

Monocular Depth Prediction
Other
462 stars 79 forks source link

Error when running test_any_images.py #51

Closed vqbang closed 3 years ago

vqbang commented 3 years ago

I try to run this piece of code to get a sample inference on google colab

!cd /content/VNL_Monocular_Depth_Prediction && python ./tools/test_any_images.py \
        --dataroot    /content/VNL_Monocular_Depth_Prediction \
        --dataset     any \
        --cfg_file     /content/VNL_Monocular_Depth_Prediction/lib/configs/resnext101_32x4d_nyudv2_class \
        --load_ckpt   /content/VNL_Monocular_Depth_Prediction/nyu_rawdata.pth

But got an error like this

----------------- Options ---------------
                batchsize: 2                             
                 cfg_file: /content/VNL_Monocular_Depth_Prediction/lib/configs/resnext101_32x4d_nyudv2_class    [default: lib/configs/resnext_32x4d_nyudv2_c1]
                 dataroot: /content/VNL_Monocular_Depth_Prediction  [default: None]
                  dataset: any                              [default: nyudv2]
                    epoch: 30                            
                load_ckpt: /content/VNL_Monocular_Depth_Prediction/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 load_dataset.py:  31: any is created.
INFO test_any_images.py:  45:  test_data_size: 0                             
Traceback (most recent call last):
  File "./tools/test_any_images.py", line 47, in <module>
    model = MetricDepthModel()
  File "../VNL_Monocular_Depth_Prediction/lib/models/metric_depth_model.py", line 16, in __init__
    self.depth_model = DepthModel()
  File "../VNL_Monocular_Depth_Prediction/lib/models/metric_depth_model.py", line 121, in __init__
    self.decoder_modules = lateral_net.fcn_topdown(cfg.MODEL.ENCODER)
  File "../VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 190, in __init__
    self._init_modules(self.init_type)
  File "../VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 193, in _init_modules
    self._init_weights(init_type)
  File "../VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 211, in _init_weights
    child_m.apply(init_func)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 445, in apply
    module.apply(fn)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 446, in apply
    fn(self)
  File "../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 "/usr/local/lib/python3.6/dist-packages/torch/nn/init.py", line 140, in normal_
    return _no_grad_normal_(tensor, mean, std)
  File "/usr/local/lib/python3.6/dist-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

Do you have any ideas ?

YvanYin commented 3 years ago

Hi,

I am sorry for the late reply. This email is in my junk bins.

Have you solved this problem? I believe this is because of the different version of pytorch.

Best, Wei


From: bang.vo notifications@github.com Sent: Wednesday, 30 December 2020 20:15 To: YvanYin/VNL_Monocular_Depth_Prediction VNL_Monocular_Depth_Prediction@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [YvanYin/VNL_Monocular_Depth_Prediction] Error when running test_any_images.py (#51)

I try to run this piece of code to get a sample inference on google colab

!cd /content/VNL_Monocular_Depth_Prediction && python ./tools/test_any_images.py \ --dataroot /content/VNL_Monocular_Depth_Prediction \ --dataset any \ --cfg_file /content/VNL_Monocular_Depth_Prediction/lib/configs/resnext101_32x4d_nyudv2_class \ --load_ckpt /content/VNL_Monocular_Depth_Prediction/nyu_rawdata.pth

But got an error like this

----------------- Options --------------- batchsize: 2 cfg_file: /content/VNL_Monocular_Depth_Prediction/lib/configs/resnext101_32x4d_nyudv2_class [default: lib/configs/resnext_32x4d_nyudv2_c1] dataroot: /content/VNL_Monocular_Depth_Prediction [default: None] dataset: any [default: nyudv2] epoch: 30 load_ckpt: /content/VNL_Monocular_Depth_Prediction/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 load_dataset.py: 31: any is created. INFO test_any_images.py: 45: test_data_size: 0 Traceback (most recent call last): File "./tools/test_any_images.py", line 47, in model = MetricDepthModel() File "../VNL_Monocular_Depth_Prediction/lib/models/metric_depth_model.py", line 16, in init self.depth_model = DepthModel() File "../VNL_Monocular_Depth_Prediction/lib/models/metric_depth_model.py", line 121, in init self.decoder_modules = lateral_net.fcn_topdown(cfg.MODEL.ENCODER) File "../VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 190, in init self._init_modules(self.init_type) File "../VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 193, in _init_modules self._init_weights(init_type) File "../VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 211, in _init_weights child_m.apply(init_func) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 445, in apply module.apply(fn) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 446, in apply fn(self) File "../VNL_Monocular_Depth_Prediction/lib/models/lateral_net.py", line 207, in initfunc nn.init.normal(m.weight.data, 1.0, 0.0) File "/usr/local/lib/python3.6/dist-packages/torch/nn/init.py", line 140, in normal_ return _no_gradnormal(tensor, mean, std) File "/usr/local/lib/python3.6/dist-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

Do you have any ideas ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/YvanYin/VNL_Monocular_Depth_Prediction/issues/51, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKVYQ543MXNU57VSZII2SV3SXLZCVANCNFSM4VOEPLEA.