mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	Resolve logger warnings (#1981)
Summary: # PR Summary This small PR resolves the annoying deprecation warnings of the `logger` library: ```python DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ``` Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1981 Reviewed By: MichaelRamamonjisoa Differential Revision: D75287169 Pulled By: bottler fbshipit-source-id: 9ff9f5dd648aca8d8bb5d33577909da711d18647
This commit is contained in:
		
							parent
							
								
									f315ac131b
								
							
						
					
					
						commit
						182e845c19
					
				@ -755,7 +755,7 @@ class SqlIndexDataset(DatasetBase, ReplaceableBase):
 | 
			
		||||
        if pick_sequences:
 | 
			
		||||
            old_len = len(eval_batches)
 | 
			
		||||
            eval_batches = [b for b in eval_batches if b[0][0] in pick_sequences]
 | 
			
		||||
            logger.warn(
 | 
			
		||||
            logger.warning(
 | 
			
		||||
                f"Picked eval batches by sequence/cat: {old_len} -> {len(eval_batches)}"
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
@ -763,7 +763,7 @@ class SqlIndexDataset(DatasetBase, ReplaceableBase):
 | 
			
		||||
            old_len = len(eval_batches)
 | 
			
		||||
            exclude_sequences = set(self.exclude_sequences)
 | 
			
		||||
            eval_batches = [b for b in eval_batches if b[0][0] not in exclude_sequences]
 | 
			
		||||
            logger.warn(
 | 
			
		||||
            logger.warning(
 | 
			
		||||
                f"Excluded eval batches by sequence: {old_len} -> {len(eval_batches)}"
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -304,11 +304,11 @@ def _show_predictions(
 | 
			
		||||
    assert isinstance(preds, list)
 | 
			
		||||
 | 
			
		||||
    pred_all = []
 | 
			
		||||
    # Randomly choose a subset of the rendered images, sort by ordr in the sequence
 | 
			
		||||
    # Randomly choose a subset of the rendered images, sort by order in the sequence
 | 
			
		||||
    n_samples = min(n_samples, len(preds))
 | 
			
		||||
    pred_idx = sorted(random.sample(list(range(len(preds))), n_samples))
 | 
			
		||||
    for predi in pred_idx:
 | 
			
		||||
        # Make the concatentation for the same camera vertically
 | 
			
		||||
        # Make the concatenation for the same camera vertically
 | 
			
		||||
        pred_all.append(
 | 
			
		||||
            torch.cat(
 | 
			
		||||
                [
 | 
			
		||||
@ -359,7 +359,7 @@ def _generate_prediction_videos(
 | 
			
		||||
    vws = {}
 | 
			
		||||
    for k in predicted_keys:
 | 
			
		||||
        if k not in preds[0]:
 | 
			
		||||
            logger.warn(f"Cannot generate video for prediction key '{k}'")
 | 
			
		||||
            logger.warning(f"Cannot generate video for prediction key '{k}'")
 | 
			
		||||
            continue
 | 
			
		||||
        cache_dir = (
 | 
			
		||||
            None
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user