File size: 880 Bytes
ddf6ca5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from ai_edge_torch import EdgeModel
import torch

def inspect_model():
    try:
        # Load the model using AI Edge Runtime
        model = EdgeModel.from_file("./model.tflite")
        
        print("\n=== Model Information ===")
        print(f"Model loaded successfully")
        
        # Get model properties
        print("\nModel Properties:")
        print(f"Device: {model.device}")
        
        # Try to get input/output information
        print("\nModel Structure:")
        print(model)
        
        return model
        
    except Exception as e:
        print(f"\nError loading model: {str(e)}")
        return None

def main():
    print("PyTorch version:", torch.__version__)
    print("Starting model inspection...")
    
    model = inspect_model()
    if model:
        print("\nModel loaded successfully!")

if __name__ == "__main__":
    main()