File size: 1,467 Bytes
975d85d 83b4f30 |
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
---
license: mit
base_model:
- facebook/sapiens
---
# Sapiens Exported Model (Schema 7.3)
This repository provides a re-exported checkpoint of the [facebook/sapiens](https://huggingface.co/facebook/sapiens) segmentation model using **PyTorch 2.5.1**, ensuring compatibility with **modern `torch.export.load()` workflows**.
---
## Background
The original SAPIENS checkpoints were exported in PyTorch 2.1.x and use **IR schema version `5.1`**, which causes `torch.export.load()` to fail on newer PyTorch versions (e.g., 2.2+), due to a mismatch in how versioning is handled internally.
Many users encounter the following error:
`ValueError: invalid literal for int() with base 10: b'5.1'`
To address this, we provide a **re-exported checkpoint** using **PyTorch 2.5.1**, which uses **schema version `7.3`**, fully compatible with current and future versions of PyTorch.
---
## Contents
- `..._bfloat16.pt2`: Re-exported IR checkpoint
- Compatible with: `torch.export.load()` in **PyTorch ≥ 2.3.0**
- Schema version: **7.3**
---
## How to Load
```python
from torch.export import load
from huggingface_hub import hf_hub_download
model_path = hf_hub_download("RyanL22/sapiens-bfloat16", "pose/checkpoints/sapiens_1b_goliath_best_goliath_AP_639_bfloat16.pt2")
model = load(model_path).module()
```
🔧 Make sure you are using PyTorch 2.3.0 or higher to ensure schema 7.x compatibility.
Credits
Original model: facebook/sapiens
Re-exported by: @RyanL22 |