Skip to content

Pretained NYU error #4

@haozhen315

Description

@haozhen315

I downloaded the pretrained nyu weights (500.pth), and edited line 138 of base_model.py to

state_dict = torch.load('.../500.pth', map_location=str(self.device))

When I run python evaluate.py --name nyu --checkpoints_dir ... --train_path ~/nyudepthv2/nyudepthv2/val/ --test_path ~/nyudepthv2/nyudepthv2/val/

I get:

           batch_size: 16                            
      checkpoints_dir: /home/haozhen/Downloads/500.pth	[default: ./checkpoints]
       continue_train: False                         
                epoch: latest                        
          epoch_count: 1                             
              gpu_ids: 0                             
            init_gain: 0.02                          
            init_type: xavier                        
              isTrain: False                         	[default: None]
                   lr: 0.001                         
      lr_decay_epochs: 100                           
       lr_decay_iters: 5000000                       
             lr_gamma: 0.9                           
            lr_policy: lambda                        
     max_dataset_size: inf                           
                model: DCCA_sparse                   
             momentum: 0.9                           
                   nP: 500                           
                 name: nyu                           	[default: experiment_name]
                niter: 400                           
              no_flip: True                          
                 norm: instance                      
          num_threads: 8                             
                phase: train                         
           print_freq: 1                             
       resize_or_crop: none                          
      save_epoch_freq: 1                             
                 seed: 0                             
       serial_batches: False                         
               suffix:                               
            test_path: /home/haozhen/Documents/nyudepthv2/val	[default: None]
           train_path: /home/haozhen/Documents/nyudepthv2/val	[default: None]
              verbose: False                         
         weight_decay: 0.0005                        

----------------- End -------------------
Found 654 images in val folder.
#test images = 654
initialize network with xavier
initialize network with xavier
model [DCCASparseNetModel] was created
loading the model from /home/haozhen/Downloads/500.pth/nyu/latest_net_DCCASparseNet.pth
---------- Networks initialized -------------
[Network DCCASparseNet] Total number of parameters : 40.417 M

torch.Size([1, 6, 224, 224]) torch.Size([1, 1, 224, 224])
Traceback (most recent call last):
File "/home/haozhen/codes/CFCNet/evaluate.py", line 99, in
model.set_new_input(data,target)
File "/home/haozhen/codes/CFCNet/models/DCCA_sparse_model.py", line 68, in set_new_input
self.mask = input[:,7,:,:].to(self.device).unsqueeze(1)
IndexError: index 7 is out of bounds for dimension 1 with size 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions