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

more .pth files needed ? #3

Closed
diraniyoussef opened this issue Feb 26, 2022 · 4 comments
Closed

more .pth files needed ? #3

diraniyoussef opened this issue Feb 26, 2022 · 4 comments

Comments

@diraniyoussef
Copy link

In the file eval_pose.py (the provided API) there is this path
data_path='/media/user/harddisk/data/kitti/Odometry/dataset'
and this model path
model_path = '/media/user/harddisk/weight/fm_depth.pth'
where to get them ?
In the pretrained weights section, the Google Drive, actually it's just the epoch_20.pth file.
Thanks.

@ArminMasoumian
Copy link
Owner

In the file eval_pose.py (the provided API) there is this path data_path='/media/user/harddisk/data/kitti/Odometry/dataset' and this model path model_path = '/media/user/harddisk/weight/fm_depth.pth' where to get them ? In the pretrained weights section, the Google Drive, actually it's just the epoch_20.pth file. Thanks.

It's the same pre-trained weight. Just change the name of "fm-depth.pth" to "epoch_20.pth"

@Hazeline2018
Copy link

When I execute run.py, it's looking for resnet50.pth pretrained weights file. the error message shows in below:

_./config/cfg_kitti_fm.py
cfg is Config (path: ./config/cfg_kitti_fm.py): {'DEPTH_LAYERS': 50, 'POSE_LAYERS': 18, 'FRAME_IDS': [0, -1, 1], 'IMGS_PER_GPU': 1, 'HEIGHT': 320, 'WIDTH': 1024, 'data': {'name': 'kitti', 'split': 'exp', 'height': 320, 'width': 1024, 'frame_ids': [0, -1, 1], 'in_path': '/run/media/armin/DATA/GCNDepth/kitti_data', 'gt_depth_path': '/run/media/armin/DATA/GCNDepth/kitti_data/gt_depths.npz', 'png': False, 'stereo_scale': False}, 'model': {'name': 'mono_fm', 'depth_num_layers': 50, 'pose_num_layers': 18, 'frame_ids': [0, -1, 1], 'imgs_per_gpu': 1, 'height': 320, 'width': 1024, 'scales': [0, 1, 2, 3], 'min_depth': 0.1, 'max_depth': 100.0, 'depth_pretrained_path': '/run/media/armin/DATA/GCNDepth/Models/resnet50.pth', 'pose_pretrained_path': '/run/media/armin/DATA/GCNDepth/Models/resnet18.pth', 'extractor_pretrained_path': '/run/media/armin/DATA/GCNDepth/Models/autoencoder.pth', 'automask': True, 'disp_norm': True, 'perception_weight': 0.001, 'smoothness_weight': 0.001}, 'resume_from': None, 'finetune': None, 'total_epochs': 40, 'imgs_per_gpu': 1, 'learning_rate': 0.0001, 'workers_per_gpu': 1, 'validate': True, 'optimizer': {'type': 'Adam', 'lr': 0.0001, 'weight_decay': 0}, 'optimizer_config': {'grad_clip': {'max_norm': 35, 'norm_type': 2}}, 'lr_config': {'policy': 'step', 'warmup': 'linear', 'warmup_iters': 500, 'warmup_ratio': 0.3333333333333333, 'step': [20, 30], 'gamma': 0.5}, 'checkpoint_config': {'interval': 1}, 'log_config': {'interval': 10, 'hooks': [{'type': 'TextLoggerHook'}]}, 'dist_params': {'backend': 'nccl'}, 'log_level': 'INFO', 'load_from': None, 'workflow': [('train', 1)], 'work_dir': 'results', 'gpus': [0]}
2022-05-25 19:39:37,068 - INFO - Distributed training: True
2022-05-25 19:39:37,068 - INFO - Set random seed to 1024
Traceback (most recent call last):
File "train.py", line 103, in
main()
File "train.py", line 78, in main
model = MONO.module_dictmodel_name
File "/home/terryl/projects/GCNDepth/mono/model/mono_fm/net.py", line 32, in init
self.opt.depth_pretrained_path)
File "/home/terryl/projects/GCNDepth/mono/model/mono_fm/depth_encoder.py", line 25, in init
checkpoint = torch.load(pretrained_path)
File "/home/terryl/miniconda3/envs/gcndepth/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/terryl/miniconda3/envs/gcndepth/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/terryl/miniconda3/envs/gcndepth/lib/python3.7/site-packages/torch/serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/run/media/armin/DATA/GCNDepth/Models/resnet50.pth'
_
Is this the same as provided 'epoch_20pth'? Should I change it to refer the requested resnet50.pth?
Also, shouldn't there be two models, restnet50 for object detection and resnet18 for depth estimation?
thanks!

@ArminMasoumian
Copy link
Owner

When I execute run.py, it's looking for resnet50.pth pretrained weights file. the error message shows in below:

_./config/cfg_kitti_fm.py cfg is Config (path: ./config/cfg_kitti_fm.py): {'DEPTH_LAYERS': 50, 'POSE_LAYERS': 18, 'FRAME_IDS': [0, -1, 1], 'IMGS_PER_GPU': 1, 'HEIGHT': 320, 'WIDTH': 1024, 'data': {'name': 'kitti', 'split': 'exp', 'height': 320, 'width': 1024, 'frame_ids': [0, -1, 1], 'in_path': '/run/media/armin/DATA/GCNDepth/kitti_data', 'gt_depth_path': '/run/media/armin/DATA/GCNDepth/kitti_data/gt_depths.npz', 'png': False, 'stereo_scale': False}, 'model': {'name': 'mono_fm', 'depth_num_layers': 50, 'pose_num_layers': 18, 'frame_ids': [0, -1, 1], 'imgs_per_gpu': 1, 'height': 320, 'width': 1024, 'scales': [0, 1, 2, 3], 'min_depth': 0.1, 'max_depth': 100.0, 'depth_pretrained_path': '/run/media/armin/DATA/GCNDepth/Models/resnet50.pth', 'pose_pretrained_path': '/run/media/armin/DATA/GCNDepth/Models/resnet18.pth', 'extractor_pretrained_path': '/run/media/armin/DATA/GCNDepth/Models/autoencoder.pth', 'automask': True, 'disp_norm': True, 'perception_weight': 0.001, 'smoothness_weight': 0.001}, 'resume_from': None, 'finetune': None, 'total_epochs': 40, 'imgs_per_gpu': 1, 'learning_rate': 0.0001, 'workers_per_gpu': 1, 'validate': True, 'optimizer': {'type': 'Adam', 'lr': 0.0001, 'weight_decay': 0}, 'optimizer_config': {'grad_clip': {'max_norm': 35, 'norm_type': 2}}, 'lr_config': {'policy': 'step', 'warmup': 'linear', 'warmup_iters': 500, 'warmup_ratio': 0.3333333333333333, 'step': [20, 30], 'gamma': 0.5}, 'checkpoint_config': {'interval': 1}, 'log_config': {'interval': 10, 'hooks': [{'type': 'TextLoggerHook'}]}, 'dist_params': {'backend': 'nccl'}, 'log_level': 'INFO', 'load_from': None, 'workflow': [('train', 1)], 'work_dir': 'results', 'gpus': [0]} 2022-05-25 19:39:37,068 - INFO - Distributed training: True 2022-05-25 19:39:37,068 - INFO - Set random seed to 1024 Traceback (most recent call last): File "train.py", line 103, in main() File "train.py", line 78, in main model = MONO.module_dictmodel_name File "/home/terryl/projects/GCNDepth/mono/model/mono_fm/net.py", line 32, in init self.opt.depth_pretrained_path) File "/home/terryl/projects/GCNDepth/mono/model/mono_fm/depth_encoder.py", line 25, in init checkpoint = torch.load(pretrained_path) File "/home/terryl/miniconda3/envs/gcndepth/lib/python3.7/site-packages/torch/serialization.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/home/terryl/miniconda3/envs/gcndepth/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/home/terryl/miniconda3/envs/gcndepth/lib/python3.7/site-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/run/media/armin/DATA/GCNDepth/Models/resnet50.pth' _ Is this the same as provided 'epoch_20pth'? Should I change it to refer the requested resnet50.pth? Also, shouldn't there be two models, restnet50 for object detection and resnet18 for depth estimation? thanks!

you can download resnet pretrained weights from these official links:
| 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
| 'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',

@Hazeline2018
Copy link

Awesome! thanks for the prompt response and help!

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

3 participants