sc_depth_pl
sc_depth_pl copied to clipboard
About resnet_encoder.py: 'self.encoder = resnets[num_layers](weights="IMAGENET1K_V1")'
when i run the demo : python inference.py --config configs/v3/nyu.txt --input_dir demo/input/ --output_dir demo/output/ --ckpt_path ckpts/nyu_scv3/epoch=93-val_loss=0.1384.ckpt --save-vis --save-depth
it occured an error about self.encoder = resnets[num_layers](weights="IMAGENET1K_V1")
Traceback (most recent call last): File "inference.py", line 83, in <module> main() File "/home/ubun/anaconda3/envs/scv3/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "inference.py", line 28, in main system = SC_DepthV3(hparams) File "/media/ubun/DATA/Projects/reference_code/sc_depth_pl-master/SC_DepthV3.py", line 18, in __init__ self.depth_net = DepthNet(self.hparams.hparams.resnet_layers) File "/media/ubun/DATA/Projects/reference_code/sc_depth_pl-master/models/DepthNet.py", line 125, in __init__ self.encoder = ResnetEncoder( File "/media/ubun/DATA/Projects/reference_code/sc_depth_pl-master/models/resnet_encoder.py", line 90, in __init__ self.encoder = resnets[num_layers](weights="IMAGENET1K_V1") File "/home/ubun/anaconda3/envs/scv3/lib/python3.8/site-packages/torchvision/models/resnet.py", line 309, in resnet18 return _resnet("resnet18", BasicBlock, [2, 2, 2, 2], pretrained, progress, **kwargs) File "/home/ubun/anaconda3/envs/scv3/lib/python3.8/site-packages/torchvision/models/resnet.py", line 294, in _resnet model = ResNet(block, layers, **kwargs) TypeError: __init__() got an unexpected keyword argument 'weights'
i have installed pytorch-lightning 1.7.3 torch-1.11.0 torchvision-0.12.0.
I hope to get your help. Thank you in advance!