dmfenton commited on
Commit
21993b0
·
1 Parent(s): 36ca9a2

Fix torch==2.5.1, clean up cache files

Browse files
.gitignore CHANGED
@@ -1 +1,7 @@
1
- .DS_Store
 
 
 
 
 
 
 
1
+ .DS_Store
2
+ __pycache__/
3
+ *.pyc
4
+ .venv*/
5
+ test_local.py
6
+ requirements-local.txt
7
+ setup_local.sh
__pycache__/main.cpython-311.pyc DELETED
Binary file (22.2 kB)
 
__pycache__/workspace.cpython-311.pyc DELETED
Binary file (4.38 kB)
 
data/__pycache__/data.cpython-311.pyc DELETED
Binary file (11.4 kB)
 
requirements-local.txt DELETED
@@ -1,25 +0,0 @@
1
- # Local testing requirements (CPU mode, no CUDA)
2
- numpy<2.0.0
3
- scikit-learn
4
- pillow
5
- torch<2.6
6
- torchvision
7
- roma
8
- matplotlib
9
- tqdm
10
- opencv-python
11
- scipy
12
- einops
13
- trimesh
14
- pyglet<2
15
- huggingface-hub
16
- lightning
17
- hydra-core
18
- jaxtyping
19
- beartype
20
- einops
21
- colorama
22
- scikit-image
23
- dacite
24
- plyfile
25
- omegaconf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
  numpy<2.0.0
2
  scikit-learn
3
  pillow-heif
4
- torch<2.6
5
  torchvision
6
  roma
7
  gradio>=6.0.0
 
1
  numpy<2.0.0
2
  scikit-learn
3
  pillow-heif
4
+ torch==2.5.1
5
  torchvision
6
  roma
7
  gradio>=6.0.0
setup_local.sh DELETED
@@ -1,19 +0,0 @@
1
- #!/bin/bash
2
- # Setup local testing environment
3
-
4
- set -e
5
-
6
- echo "Creating virtual environment..."
7
- python3 -m venv .venv-local
8
-
9
- echo "Activating..."
10
- source .venv-local/bin/activate
11
-
12
- echo "Installing dependencies..."
13
- pip install --upgrade pip
14
- pip install -r requirements-local.txt
15
-
16
- echo ""
17
- echo "Done! To test:"
18
- echo " source .venv-local/bin/activate"
19
- echo " python test_local.py"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/mast3r_src/mast3r/__pycache__/__init__.cpython-311.pyc DELETED
Binary file (184 Bytes)
 
src/mast3r_src/mast3r/__pycache__/catmlp_dpt_head.cpython-311.pyc DELETED
Binary file (15.3 kB)
 
src/mast3r_src/mast3r/__pycache__/losses.cpython-311.pyc DELETED
Binary file (31.1 kB)
 
src/mast3r_src/mast3r/__pycache__/model.cpython-311.pyc DELETED
Binary file (4.44 kB)
 
src/mast3r_src/mast3r/utils/__pycache__/__init__.cpython-311.pyc DELETED
Binary file (190 Bytes)
 
src/mast3r_src/mast3r/utils/__pycache__/misc.cpython-311.pyc DELETED
Binary file (829 Bytes)
 
src/mast3r_src/mast3r/utils/__pycache__/path_to_dust3r.cpython-311.pyc DELETED
Binary file (955 Bytes)
 
src/pixelsplat_src/__pycache__/benchmarker.cpython-311.pyc DELETED
Binary file (3.93 kB)
 
src/pixelsplat_src/__pycache__/cuda_splatting.cpython-311.pyc DELETED
Binary file (10.1 kB)
 
src/pixelsplat_src/__pycache__/decoder_splatting_cuda.cpython-311.pyc DELETED
Binary file (4.4 kB)
 
src/pixelsplat_src/__pycache__/projection.cpython-311.pyc DELETED
Binary file (9.83 kB)
 
test_local.py DELETED
@@ -1,101 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Local test script to debug model loading without GPU."""
3
-
4
- import sys
5
- import os
6
-
7
- # MUST BE FIRST: Fix for PyTorch 2.6+ weights_only default change
8
- print("1. Importing torch and applying patch...")
9
- import torch
10
- _original_torch_load = torch.load
11
- def _patched_torch_load(*args, **kwargs):
12
- kwargs.setdefault('weights_only', False)
13
- return _original_torch_load(*args, **kwargs)
14
- torch.load = _patched_torch_load
15
- print(f" torch version: {torch.__version__}")
16
- print(f" torch.load patched: {torch.load != _original_torch_load}")
17
-
18
- # Force CPU mode
19
- os.environ['CUDA_VISIBLE_DEVICES'] = ''
20
- print(f" CUDA available: {torch.cuda.is_available()}")
21
-
22
- # Setup paths
23
- sys.path.insert(0, 'src/mast3r_src')
24
- sys.path.insert(0, 'src/mast3r_src/dust3r')
25
- sys.path.insert(0, 'src/pixelsplat_src')
26
-
27
- print("\n2. Testing imports...")
28
- try:
29
- from dust3r.utils.image import load_images
30
- print(" dust3r.utils.image: OK")
31
- except Exception as e:
32
- print(f" dust3r.utils.image: FAILED - {e}")
33
-
34
- try:
35
- from mast3r.utils.misc import hash_md5
36
- print(" mast3r.utils.misc: OK")
37
- except Exception as e:
38
- print(f" mast3r.utils.misc: FAILED - {e}")
39
-
40
- try:
41
- import main
42
- print(" main: OK")
43
- except Exception as e:
44
- print(f" main: FAILED - {e}")
45
- import traceback
46
- traceback.print_exc()
47
-
48
- print("\n3. Downloading model weights...")
49
- try:
50
- from huggingface_hub import hf_hub_download
51
- model_name = "brandonsmart/splatt3r_v1.0"
52
- filename = "epoch=19-step=1200.ckpt"
53
- weights_path = hf_hub_download(repo_id=model_name, filename=filename)
54
- print(f" Downloaded: {weights_path}")
55
- except Exception as e:
56
- print(f" FAILED: {e}")
57
- sys.exit(1)
58
-
59
- print("\n4. Testing torch.load directly...")
60
- try:
61
- # This should use our patched version
62
- ckpt = torch.load(weights_path, map_location='cpu')
63
- print(f" torch.load: OK (keys: {list(ckpt.keys())[:5]}...)")
64
- except Exception as e:
65
- print(f" torch.load: FAILED - {e}")
66
- import traceback
67
- traceback.print_exc()
68
- sys.exit(1)
69
-
70
- print("\n5. Testing model instantiation...")
71
- try:
72
- device = torch.device('cpu')
73
- model = main.MAST3RGaussians.load_from_checkpoint(weights_path, device)
74
- print(f" Model loaded: OK")
75
- print(f" Model type: {type(model)}")
76
- except Exception as e:
77
- print(f" Model load: FAILED - {e}")
78
- import traceback
79
- traceback.print_exc()
80
- sys.exit(1)
81
-
82
- print("\n6. Testing image loading...")
83
- try:
84
- # Use a test image if available
85
- test_images = []
86
- for img in ['../IMG_2043.jpg', '../IMG_2044.jpg']:
87
- if os.path.exists(img):
88
- test_images.append(img)
89
-
90
- if test_images:
91
- imgs = load_images(test_images[:2] if len(test_images) >= 2 else test_images * 2, size=512, verbose=True)
92
- print(f" Images loaded: {len(imgs)}")
93
- print(f" Image shape: {imgs[0]['img'].shape}")
94
- else:
95
- print(" No test images found, skipping")
96
- except Exception as e:
97
- print(f" Image load: FAILED - {e}")
98
- import traceback
99
- traceback.print_exc()
100
-
101
- print("\n✓ All tests passed!")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
utils/__pycache__/compute_ssim.cpython-311.pyc DELETED
Binary file (1.91 kB)
 
utils/__pycache__/export.cpython-311.pyc DELETED
Binary file (20 kB)
 
utils/__pycache__/geometry.cpython-311.pyc DELETED
Binary file (7.54 kB)
 
utils/__pycache__/loss_mask.cpython-311.pyc DELETED
Binary file (5.56 kB)
 
utils/__pycache__/sh_utils.cpython-311.pyc DELETED
Binary file (4.68 kB)